Link to home
Start Free TrialLog in
Avatar of GGRUNDY
GGRUNDY

asked on

InternetConnect http question

I'm haveing a bit of trouble understanding the WinInet InternetConnect function call as it applies to username & password for a http session.

The documentation says:
; a NULL parameter in HTTP causes the server to return an error
Is that really true!!?? and just what is InternetConnect doing at this point for a http session? Just opening a socket? If so what would it do with any username and password supplied anyway? Maybe save them up and use them in subsequent HttpOpenRequest?

Any insight into what is going on with respect to user details and the InternetConnect function as far as http is concerned would be greatly appreciated.
Avatar of robpitt
robpitt

Darn good question! I see no reason why NULL could not have been accepted yet the docs do indeed state a username paramter is required for HTTP.


As for asking for the username/password at this early stage, well I guess its just so that it can cache it for use later on when a page requiring authentication is encountered.
ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GGRUNDY

ASKER

Hi Guys thanks for your comments thus far.
But I'm still pretty interested in what (if anything) it does with username & password in the case of internet connection.
I have since found a document which says that in the case of a HTTP connection InternetConnect doesn't go anywhere near the site at that point. http://msdn.microsoft.com/workshop/networking/wininet/overview/enable.asp
From the article
InternetConnect does not attempt to access or establish a connection to the specified site, except in the case of an ftp session.

I also note that MFC's CHttpConnection class seems quite keen to pass NULL parameters for Username and Password. So it is probably the documentation in error. (Although the above article repeats the fallacy).
(In fact I get the impression from the documentation of the InternetConnect function had an author with only a passing acquaintanceship with the English language).
Avatar of GGRUNDY

ASKER

Thanks for trying anyway guys