HttpEndRequestA function (wininet.h)

Ends an HTTP request that was initiated by HttpSendRequestEx.


BOOL HttpEndRequestA(
  [in]            HINTERNET           hRequest,
  [out, optional] LPINTERNET_BUFFERSA lpBuffersOut,
  [in]            DWORD               dwFlags,
  [in, optional]  DWORD_PTR           dwContext


[in] hRequest

Handle returned by HttpOpenRequest and sent by HttpSendRequestEx.

[out, optional] lpBuffersOut

This parameter is reserved and must be NULL.

[in] dwFlags

This parameter is reserved and must be set to 0.

[in, optional] dwContext

This parameter is reserved and must be set to 0.

Return value

If the function succeeds, the function returns TRUE.

If the function fails, it returns FALSE. To get extended error information, call GetLastError.


If lpBuffersOut is not set to NULL, HttpEndRequest will return ERROR_INVALID_PARAMETER.

Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.

Note  WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).


The wininet.h header defines HttpEndRequest as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wininet.h
Library Wininet.lib
DLL Wininet.dll

See also

HTTP Sessions

WinINet Functions