🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #159

Indy 9 HTTP Client and Authentication?

#159
From: Chris
Date: Thu, 13 Sep 2007 17:34
42 lines
2250 bytes
Hi, 
    I am trying to use the IdHTTP component from Indy 9 to 
request a JPEG file from a camera server. I was using the 
CppWebBrowser component, which worked great, until I found that 
I needed to handle authentication with some servers. I already 
have the usernames and passwords stored and I just want to be 
able to pass them to the server "on-the-fly" without even 
seeing the login dialogue box. I will leave the code I was 
using with the CppWebBrowser component that does work until I 
try to access a server that requires authentication. 

If I can do Authentication with cppWebBrowser, then I will 
stick to that. I am just looking for the best solution to solve 
my current problem. If Indy HTTP Client is the best solution, 
then I will need some sample code as far as being able to 
navigate to the webpages correctly. I can't find a c++ demo and 
I am having trouble testing out the IdHTTP component.  


----------------------------------------------------------------
cppWebBrowser1->Visible = false;

String ptzUrl = "http://192.168.1.101/jpg/1/image.jpg";

WideString url = ptzUrl;
cppWebBrowser1->Navigate( url.c_bstr());

String fname = "C:\\JPGTest.jpg";

URLDownloadToFile(NULL,ptzUrl.c_str(),fname.c_str(),0,NULL);

if(FileExists(fname)){
       Image1->Picture->LoadFromFile(fname);

       DeleteFile(fname); 
}
---------------------------------------------------------------

Thanks,

Chris
Technical Details
Message-ID: <46e974aa$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,f4de428f9278b0d3,start
X-Google-Attributes: gidfeeec,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Chris" <chris@privacy.com>
Sender: "Chris" <chris@privacy.com>
Reply-To: "Chris" <chris@privacy.com>
Subject: Indy 9 HTTP Client and Authentication?
Newsgroups: borland.public.cppbuilder.internet.web
X-User-Info: 70.46.79.254     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <46e974aa$1@newsgroups.borland.com>
Date: 13 Sep 2007 10:34:34 -0700
X-Trace: newsgroups.borland.com 1189704874 207.105.83.66 (13 Sep 2007 10:34:34 -0700)
Lines: 42
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail