Purpose
Opens an HTTP connection.
Syntax
MIOpenRequestFull( ByVal hConnection As CHttpConnection,
ByVal nVerb As Integer, ByVal strObjectName As String,
ByVal strReferer As String, ByVal dwContext As Integer,
ByVal strVersion As String, ByVal dwFlags As Integer )
As CHttpFile
hConnection is a CHttpConnection handle.
nVerb is a number associated with the HTTP request type. Can be one of the following:
- HTTP_VERB_POST
- HTTP_VERB_GET
- HTTP_VERB_HEAD
- HTTP_VERB_PUT
- HTTP_VERB_LINK
- HTTP_VERB_DELETE
- HTTP_VERB_UNLINK
strObjectName is a string containing the target object of the specified verb. This is generally a file name, an executable module, or a search specifier.
strReferer is a string that specifies the address (URL) of the document from which the URL in the request (strObjectName) was obtained. If the string is empty, no HTTP header is specified.
dwContext is the context identifier for the MIOpenRequestFull() operation. For detailed information, refer to the Microsoft MSDN library.
strVersion is a string defining the HTTP version. If the string is empty, "HTTP/1.0" is used.
dwFlags is any combination of the following INTERNET_ FLAG_* flags:
dwFlag value | Definition |
---|---|
INTERNET_FLAG_RELOAD | Forces a download of the requested file, object, or directory listing from the origin server, not from the cache. |
INTERNET_ FLAG_DONT_CACHE | Does not add the returned entry to the cache. |
INTERNET_FLAG_MAKE_PERSISTENT | 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. |
INTERNET_ FLAG_SECURE | Use secure transaction semantics. This translates to using SSL/PCT and is only meaningful in HTTP requests. |
INTERNET_ FLAG_NO_AUTO_REDIRECT | Used only with HTTP, specifies that redirection should not be automatically handled in the MISendRequest() function. |
Return Value
A handle to a CHttpFile object requested. If the call fails, Null is returned. To determine the cause of the failure, call the MIGetErrorMessage() function.
Description
This function opens an HTTP connection and returns a handle to a CHttpFile object, which provides services requesting and reading files on an HTTP server. If your Internet session reads data from an HTTP server, you must get a handle to CHttpFile object. This function wraps the MFC function OpenRequest which has an additional parameter to indicate accepted types. In this version, the wrapper function always sets this parameter to NULL.
The caller has to dispose of the handle by calling the MICloseHttpFile() procedure when the handle is no longer in use.