This documentation is archived and is not being maintained.


This topic has been updated for Visual Studio 2005 SP1.

Call this member function to end a request sent to an HTTP server with the SendRequestEx member function.

BOOL EndRequest(
   DWORD dwFlags = 0,
   DWORD_PTR dwContext = 1 



Flags describing the operation. For a list of the appropriate flags, see HttpEndRequest in the Platform SDK.


Pointer to an initialized INTERNET_BUFFERS that describes the input buffer used for the operation.


The context identifier for the CHttpFile operation. See Remarks for more information about this parameter.

Nonzero if successful; otherwise 0. If the call fails, determine the cause of the failure by examining the thrown CInternetException object.

The default value for dwContext is sent by MFC to the CHttpFile object from the CInternetSession object that created the CHttpFile object. When you call CInternetSession::OpenURL or CHttpConnection to construct a CHttpFile object, you can override the default to set the context identifier to a value of your choosing. The context identifier is returned to CInternetSession::OnStatusCallback to provide status on the object with which it is identified. See article Internet First Steps: WinInet for more information about the context identifier.

This method can throw exceptions of type CInternetException*.

This section has been updated for Visual Studio 2005 SP1.

This method is not supported in Smart Device projects.