Skip to content

Commit

Permalink
Adds documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbj29 committed Nov 7, 2023
1 parent 4f888ea commit 3389429
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions source/include/core_http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,41 @@ HTTPStatus_t HTTPClient_AddRangeHeader( HTTPRequestHeaders_t * pRequestHeaders,
int32_t rangeEnd );
/* @[declare_httpclient_addrangeheader] */

/**
* @brief Send the request headers in @p pRequestHeaders over the transport.
*
If #HTTP_SEND_DISABLE_CONTENT_LENGTH_FLAG is not set in parameter @p sendFlags,
* then the Content-Length to be sent to the server is automatically written to
* @p 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:
* - #HTTPSecurityAlertExtraneousResponseData
* - #HTTPSecurityAlertInvalidChunkHeader
* - #HTTPSecurityAlertInvalidProtocolVersion
* - #HTTPSecurityAlertInvalidStatusCode
* - #HTTPSecurityAlertInvalidCharacter
* - #HTTPSecurityAlertInvalidContentLength
*
*
* @param[in] pTransport Transport interface, see #TransportInterface_t for
* more information.
* @param[in] getTimestampMs Function to retrieve a timestamp in milliseconds.
* @param[in] pRequestHeaders Request configuration containing the buffer of headers to
* send.
* @param[in] reqBodyLen The length of the request entity in bytes.
* @param[in] sendFlags Flags which modify the behavior of this function. Please see @ref
* http_send_flags for more information.
*
* @return #HTTPSuccess if successful. If there was a network error or less
* bytes than what were specified were sent, then #HTTPNetworkError is
* returned.
*
*/
/* @[declare_httpclient_sendhttpheaders] */
HTTPStatus_t HTTPClient_SendHttpHeaders( const TransportInterface_t * pTransport,
HTTPClient_GetCurrentTimeFunc_t getTimestampMs,
Expand All @@ -745,6 +780,19 @@ HTTPStatus_t HTTPClient_SendHttpHeaders( const TransportInterface_t * pTransport
uint32_t sendFlags );
/* @[declare_httpclient_sendhttpheaders] */

/**
* @brief Send the request body in @p pRequestBodyBuf over the transport.
*
* @param[in] pTransport Transport interface, see #TransportInterface_t for
* more information.
* @param[in] getTimestampMs Function to retrieve a timestamp in milliseconds.
* @param[in] pData HTTP request data to send.
* @param[in] dataLen HTTP request data length.
*
* @return #HTTPSuccess if successful. If there was a network error or less
* bytes than what were specified were sent, then #HTTPNetworkError is
* returned.
*/
/* @[declare_httpclient_sendhttpdata] */
HTTPStatus_t HTTPClient_SendHttpData( const TransportInterface_t * pTransport,
HTTPClient_GetCurrentTimeFunc_t getTimestampMs,
Expand Down Expand Up @@ -854,6 +902,21 @@ HTTPStatus_t HTTPClient_Send( const TransportInterface_t * pTransport,
uint32_t sendFlags );
/* @[declare_httpclient_send] */

/**
* @brief Receive the HTTP response from the network and parse it.
*
* @param[in] pTransport Transport interface, see #TransportInterface_t for more
* information.
* @param[in] pResponse The response message and some notable response parameters will be
* returned here on success.
* @param[in] pRequestHeaders Request configuration containing the buffer of headers to
* send.
*
* @return Returns #HTTPSuccess if successful. #HTTPNetworkError for a transport
* receive error. Please see #parseHttpResponse and #getFinalResponseStatus for
* other statuses returned.
*
*/
/* @[declare_httpclient_receiveandparsehttpresponse] */
HTTPStatus_t HTTPClient_ReceiveAndParseHttpResponse( const TransportInterface_t * pTransport,
HTTPResponse_t * pResponse,
Expand Down

0 comments on commit 3389429

Please sign in to comment.