Microsoft Windows CE 3.0  

HttpSendRequest

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function sends the specified request to the HTTP server.

BOOL WINAPI HttpSendRequest(
HINTERNET
hRequest
,
LPCTSTR
lpszHeaders
,
DWORD
dwHeadersLength
,
LPVOID
lpOptional
,
DWORD
dwOptionalLength
);

Parameters

hRequest
[in] Open HTTP request handle returned by HttpOpenRequest.
lpszHeaders
[in] Long pointer to null-terminated strings that contain additional headers to be appended to the request. This parameter can be NULL if there are no additional headers to append.
dwHeadersLength
[in] Specifies the length, in characters, of the additional headers. If this parameter is -1L and lpszHeadersis not NULL, the function assumes that lpszHeadersis zero-terminated (ASCIIZ), and the length is calculated.
lpOptional
[in] Long pointer to any optional data to send immediately after the request headers. This parameter is generally used for POST and PUT operations. The optional data can be the resource or information being posted to the server. This parameter can be NULL if there is no optional data to send.
dwOptionalLength
[in] Specifies the length, in bytes, of the optional data. This parameter can be zero if there is no optional data to send.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError.

Remarks

HttpSendRequestsends the specified request to the HTTP server and allows the client to specify additional headers to send along with the request.

The function also lets the client specify optional data to send to the HTTP server immediately following the request headers. This feature is generally used for "write" operations such as PUT and POST. When using optional data, be aware of the following caveat: the size of the optional data buffer, specified with the dwOptionalLengthparameter, must be either less than 32 bytes or greater than approximately 150 bytes. Otherwise, the HttpSendRequestfunction fails.

Another caveat requires that the optional data buffer begin with '/r/n'. This ensures that header and buffer is separated by '/r/n/r/n' as required by RFC 2068.

After the request is sent, the status code and response headers from the HTTP server are read. These headers are maintained internally and are available to client applications through the HttpQueryInfofunction.

An application can use the same HTTP request handle in multiple calls to HttpSendRequest, but the application must read all data returned from the previous call before calling the function again.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Wininet.h   Wininet.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, HttpOpenRequest, HttpQueryInfo, InternetReadFile