This topic has been updated for Visual Studio 2005 SP1.
Call this member function to open an HTTP connection.
CHttpFile* OpenRequest( LPCTSTR pstrVerb, LPCTSTR pstrObjectName, LPCTSTR pstrReferer = NULL, DWORD_PTR dwContext = 1, LPCTSTR* ppstrAcceptTypes = NULL, LPCTSTR pstrVersion = NULL, DWORD dwFlags = INTERNET_FLAG_EXISTING_CONNECT ); CHttpFile* OpenRequest( int nVerb, LPCTSTR pstrObjectName, LPCTSTR pstrReferer = NULL, DWORD_PTR dwContext = 1, LPCTSTR* ppstrAcceptTypes = NULL, LPCTSTR pstrVersion = NULL, DWORD dwFlags = INTERNET_FLAG_EXISTING_CONNECT );
A pointer to a string containing the verb to use in the request. If NULL, "GET" is used.
A pointer to a string containing the target object of the specified verb. This is generally a filename, an executable module, or a search specifier.
A pointer to a string that specifies the address (URL) of the document from which the URL in the request (pstrObjectName) was obtained. If NULL, no HTTP header is specified.
The context identifier for the OpenRequest operation. See Remarks for more information about dwContext.
A pointer to a null-terminated array of LPCTSTR pointers to strings indicating content types accepted by the client. If ppstrAcceptTypes is NULL, the servers interpret that the client only accepts documents of type "text/*" (that is, only text documents and not pictures or other binary files). The content type is equivalent to the CGI variable CONTENT_TYPE, which identifies the type of data for queries that have attached information, such as HTTP POST and PUT.
A pointer to a string defining the HTTP version. If NULL, "HTTP/1.0" is used.
Any combination of the INTERNET_ FLAG_* flags. See the Remarks for a description of possible dwFlags values.
A number associated with the HTTP request type. Can be one of the following:
HTTP request type nVerb value
dwFlags can be one of the following:
Forces a download of the requested file, object, or directory listing from the origin server, not from the cache.
Does not add the returned entity to the cache.
Adds the returned entity to the cache as a persistent entity. This means that standard cache cleanup, consistency checking, or garbage collection cannot remove this item from the cache.
Uses secure transaction semantics. This translates to using SSL/PCT and is only meaningful in HTTP requests
Used only with HTTP, specifies that redirections should not be automatically handled in CHttpFile::SendRequest.
Override the dwContext default to set the context identifier to a value of your choosing. The context identifier is associated with this specific operation of the CHttpConnection object created by its CInternetSession object. The value is returned to CInternetSession::OnStatusCallback to provide status on the operation with which it is identified. See the article Internet First Steps: WinInet for more information about the context identifier.