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
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