Share via


CInternetSession::GetHttpConnection

CHttpConnection* GetHttpConnection( LPCTSTR pstrServer**, INTERNET_PORT** nPort = INTERNET_INVALID_PORT_NUMBER, LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL );
Throw ( CInternetException );

CHttpConnection* GetHttpConnection( LPCTSTR pstrServer**, DWORD** dwflags**, INTERNET_PORT** nPort = INTERNET_INVALID_PORT_NUMBER, LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL );
Throw ( CInternetException );

Return Value

A pointer to a CHttpConnection object. If the call fails, determine the cause of the failure by examining the thrown CInternetException object.

Parameters

pstrServer

A pointer to a string containing the HTTP server name.

nPort

A number that identifies the TCP/IP port to use on the server.

pstrUserName

A pointer to a string containing the user name.

pstrPassword

A pointer to a string containing the access password.

dwflags

The flags describing

Remarks

Call this member function to establish an HTTP connection and get a pointer to a CHttpConnection object.

GetHttpConnection connects to an HTTP server, and creates and returns a pointer to a CHttpConnection object. It does not perform any specific operation on the server. If you intend to query an HTTP header, for example, you must perform this operation as a separate step. See the classes CHttpConnection and CHttpFile for information about operations you can perform by using a connection to an HTTP server. For information about browsing an HTTP site, see the member function OpenURL. See the article in Visual C++ Programmer’s Guide for steps in performing common HTTP connection tasks.

CInternetSession OverviewClass MembersHierarchy Chart

See Also   CHttpConnection, CInternetSession::GetGopherConnection, CInternetSession::GetFtpConnection, CInternetSession::OpenURL