TuyaOS
成员变量
http_resp_t结构体 参考

#include <httpc.h>

成员变量

bool_t chunked
 
const char * content_encoding
 
unsigned int content_length
 
const char * content_type
 
bool_t keep_alive_ack
 
int keep_alive_max
 
int keep_alive_timeout
 
const char * location
 
time_t modify_time
 
const char * p_accept_ranges
 
const char * protocol
 
const char * reason_phrase
 
const char * server
 
int status_code
 
http_ver_t version
 

详细描述

Structure used to give back http header response fields to the caller.

结构体成员变量说明

◆ chunked

bool_t http_resp_t::chunked

This will be 'true' if "Transfer-Encoding" field is set to "chunked". Note that this is only for information and the API http_read_content() transparently handles chunked reads.

◆ content_encoding

const char* http_resp_t::content_encoding

The value of "Content-Encoding" header field e.g. "gzip"

◆ content_length

unsigned int http_resp_t::content_length

Value of the "Content-Length" field. If "Transfer-Encoding" is set to chunked then this value will be zero.

◆ content_type

const char* http_resp_t::content_type

The value of "Content-Type" header field. e.g. "text/html"

◆ keep_alive_ack

bool_t http_resp_t::keep_alive_ack

If "Keep-Alive" field is present or if the value of "Connection" field is "Keep-Alive" then this member is set to 'true'. It is set to 'false' in other cases

◆ keep_alive_max

int http_resp_t::keep_alive_max

If "Keep-Alive" field is present in the response, this member contains the value of the "max" sub-field of this field. The max parameter indicates the maximum number of requests that a client will make, or that a server will allow to be made on the persistent connection.

◆ keep_alive_timeout

int http_resp_t::keep_alive_timeout

If "Keep-Alive" field is present in the response, this member contains the value of the "timeout" sub-field of this field. This is the time the server will allow an idle connection to remain open before it is closed.

◆ location

const char* http_resp_t::location

HTTP "Location" header field value

◆ modify_time

time_t http_resp_t::modify_time

Last-Modified header field value in POSIX time format

◆ p_accept_ranges

const char* http_resp_t::p_accept_ranges

Accept-Ranges

◆ protocol

const char* http_resp_t::protocol

The value of the protocol field in the first line of the HTTP header response. e.g. "HTTP".

◆ reason_phrase

const char* http_resp_t::reason_phrase

The ASCII string present in the first line of HTTP response. It is the verbose representation of status code. e.g. "OK" if status_code is 200

◆ server

const char* http_resp_t::server

HTTP "Server" header field value

◆ status_code

int http_resp_t::status_code

The status code returned as a part of the first line of the HTTP response e.g. 200 if success

◆ version

http_ver_t http_resp_t::version

HTTP version


该结构体的文档由以下文件生成: