HttpAddRequestHeaders function
Adds one or more HTTP request headers to the HTTP request handle.
Syntax
BOOL HttpAddRequestHeaders( _In_ HINTERNET hRequest, _In_ LPCTSTR lpszHeaders, _In_ DWORD dwHeadersLength, _In_ DWORD dwModifiers );
Parameters
- hRequest [in]
-
A handle returned by a call to the HttpOpenRequest function.
- lpszHeaders [in]
-
A pointer to a string variable containing the headers to append to the request. Each header must be terminated by a CR/LF (carriage return/line feed) pair.
- dwHeadersLength [in]
-
The size of lpszHeaders, in TCHARs. If this parameter is -1L, the function assumes that lpszHeaders is zero-terminated (ASCIIZ), and the length is computed.
- dwModifiers [in]
-
A set of modifiers that control the semantics of this function. This parameter can be a combination of the following values.
Return value
Returns TRUE if successful, or FALSE otherwise. To get extended error information, call GetLastError.
Remarks
HttpAddRequestHeaders appends additional, free-format headers to the HTTP request handle and is intended for use by sophisticated clients that need detailed control over the exact request sent to the HTTP server.
Note that for basic HttpAddRequestHeaders, the application can pass in multiple headers in a single buffer. If the application is trying to remove or replace a header, only one header can be supplied in lpszHeaders.
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.
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
HttpAddRequestHeadersW (Unicode) and HttpAddRequestHeadersA (ANSI) |
See also