Struct SYN_HttpClient¶
HTTP client context structure.
#include <syn_http.h>
Public Attributes¶
| Type | Name |
|---|---|
| const uint8_t * | body |
| SYN_HttpBodyCallback | body_cb |
| size_t | body_len |
| uint32_t | body_remaining |
| size_t | body_start |
| uint32_t | body_timeout_ms |
| size_t | buf_pos |
| size_t | buf_used |
| void * | cb_ctx |
| char | chunk_line |
| size_t | chunk_line_pos |
| uint32_t | chunk_remaining |
| uint8_t | chunk_state |
| const char * | content_type |
| char | cur_host |
| char | cur_path |
| uint16_t | cur_port |
| uint8_t | header_count |
| uint32_t | header_timeout_ms |
| const SYN_HttpHeader * | headers |
| int | hops |
| const char * | host |
| bool | known_length |
| size_t | line_len |
| const char * | method |
| const char * | path |
| uint16_t | port |
| SYN_HttpResponse | resp |
| SYN_Socket | sock |
| SYN_HttpState | state |
| SYN_Status | status |
| uint8_t * | work_buf |
| size_t | work_buf_size |
Public Attributes Documentation¶
variable body¶
Request body buffer for POST, or NULL
variable body_cb¶
Callback function to stream response body
variable body_len¶
Request body length, or 0
variable body_remaining¶
Number of expected body bytes remaining
variable body_start¶
Index in work_buf where body data begins
variable body_timeout_ms¶
Body receive timeout threshold
variable buf_pos¶
Read cursor within the work_buf
variable buf_used¶
Active bytes stored in work_buf
variable cb_ctx¶
User context for the body callback
variable chunk_line¶
Parser buffer for reading chunk length text
variable chunk_line_pos¶
Write cursor in chunk_line
variable chunk_remaining¶
Current chunk bytes remaining to read
variable chunk_state¶
Internal parser state (0: size line, 1: data, 2: trailing CRLF)
variable content_type¶
Content-Type for POST payload, or NULL
variable cur_host¶
Cached current redirect hostname
variable cur_path¶
Cached current redirect path
variable cur_port¶
Cached current redirect port
variable header_count¶
Number of custom request headers
variable header_timeout_ms¶
Header receive timeout threshold
variable headers¶
Optional array of custom request headers
variable hops¶
Redirect hop counter to prevent crash loops
variable host¶
Hostname to query
variable known_length¶
True if Content-Length was provided
variable line_len¶
Length of the current parsed line
variable method¶
HTTP method (e.g. "GET", "POST")
variable path¶
Resource path on the server (e.g. "/index.html")
variable port¶
Port to connect to (typically 80)
variable resp¶
Parsed response status and headers
variable sock¶
Client TCP network socket handle
variable state¶
Current client state machine state
variable status¶
Final transaction execution status
variable work_buf¶
Work buffer for socket transmission and parsing
variable work_buf_size¶
Capacity of the work buffer
The documentation for this class was generated from the following file src/syntropic/net/syn_http.h