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.
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.
A set of modifiers that control the semantics of this function. This parameter can be a combination of the following values.
Adds the header if it does not exist. Used with HTTP_ADDREQ_FLAG_REPLACE.
Adds the header only if it does not already exist; otherwise, an error is returned.
Coalesces headers of the same name.
Coalesces headers of the same name. For example, adding "Accept: text/*" followed by "Accept: audio/*" with this flag results in the formation of the single header "Accept: text/*, audio/*". This causes the first header found to be coalesced. It is up to the calling application to ensure a cohesive scheme with respect to coalesced/separate headers.
Coalesces headers of the same name using a semicolon.
Replaces or removes a header. If the header value is empty and the header is found, it is removed. If not empty, the header value is replaced.
Returns TRUE if successful, or FALSE otherwise. To get extended error information, call
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
Note The HttpAddRequestHeadersA function represents headers as ISO-8859-1 characters not ANSI characters. The HttpAddRequestHeadersW function represents headers as ISO-8859-1 characters converted to UTF-16LE characters. As a result, it is never safe to use the HttpAddRequestHeadersW function when the headers to be added can contain non-ASCII characters.
Instead, an application can use the MultiByteToWideChar and WideCharToMultiByte functions with a Codepage parameter set to 28591 to map between ANSI characters and UTF-16LE characters.
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.