Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
http_response Struct Reference

#include <http_client.h>

Data Fields

const struct http_parser_settingshttp_cb
 
http_response_cb_t cb
 
uint8_tbody_start
 
uint8_trecv_buf
 
size_t recv_buf_len
 
size_t data_len
 
size_t content_length
 
size_t processed
 
char http_status [32]
 
uint16_t http_status_code
 
uint8_t cl_present: 1
 
uint8_t body_found: 1
 
uint8_t message_complete: 1
 

Detailed Description

HTTP response from the server.

Field Documentation

◆ body_found

uint8_t http_response::body_found

◆ body_start

uint8_t* http_response::body_start

Where the body starts

◆ cb

http_response_cb_t http_response::cb

User provided HTTP response callback which is called when a response is received to a sent HTTP request.

◆ cl_present

uint8_t http_response::cl_present

◆ content_length

size_t http_response::content_length

HTTP Content-Length field value

◆ data_len

size_t http_response::data_len

Length of the data in the result buf. If the value is larger than recv_buf_len, then it means that the data is truncated and could not be fully copied into recv_buf. This can only happen if the user did not set the response callback. If the callback is set, then the HTTP client API will call response callback many times so that all the data is delivered to the user.

◆ http_cb

const struct http_parser_settings* http_response::http_cb

HTTP parser settings for the application usage

◆ http_status

char http_response::http_status[32]

◆ http_status_code

uint16_t http_response::http_status_code

Numeric HTTP status code which corresponds to the textual description.

◆ message_complete

uint8_t http_response::message_complete

◆ processed

size_t http_response::processed

Content length parsed. This should be the same as the content_length field if parsing was ok.

◆ recv_buf

uint8_t* http_response::recv_buf

Where the response is stored, this is to be provided by the user.

◆ recv_buf_len

size_t http_response::recv_buf_len

Response buffer maximum length


The documentation for this struct was generated from the following file: