Send the request headers in HTTPRequestHeaders_t.pBuffer and request body in pRequestBodyBuf
over the transport. The response is received in HTTPResponse_t.pBuffer.
If HTTP_SEND_DISABLE_CONTENT_LENGTH_FLAG is not set in parameter sendFlags
, then the Content-Length to be sent to the server is automatically written to pRequestHeaders
. The Content-Length will not be written when there is no request body. If there is not enough room in the buffer to write the Content-Length then HTTPInsufficientMemory is returned. Please see HTTP_MAX_CONTENT_LENGTH_HEADER_LENGTH for the maximum Content-Length header field and value that could be written to the buffer.
The application should close the connection with the server if any of the following errors are returned:
The pResponse
returned is valid only if this function returns HTTPSuccess.
[in] | pTransport | Transport interface, see TransportInterface_t for more information. |
[in] | pRequestHeaders | Request configuration containing the buffer of headers to send. |
[in] | pRequestBodyBuf | Optional Request entity body. Set to NULL if there is no request body. |
[in] | reqBodyBufLen | The length of the request entity in bytes. |
[in] | pResponse | The response message and some notable response parameters will be returned here on success. |
[in] | sendFlags | Flags which modify the behavior of this function. Please see HTTPClient_Send Flags for more information. |
Example