httpclient
HTTP Client Helpers
Functions
| Function | Description |
|---|---|
_hcli_byte_at | Internal byte reader. |
_hcli_copy | Internal: copy bytes. |
_hcli_parse_int | Internal: parse integer from ASCII digits at position. |
_hcli_find_body | Internal: find double CRLF. Returns offset of body start or -1. |
_hcli_lower | Internal: compare bytes case-insensitively. |
_hcli_eq_nocase | |
http_parse_response | Parse an HTTP response. Returns handle. |
http_resp_status | Get status code. |
http_resp_header | Get a header value. Searches for “Name: value\r\n”. Returns length of value c… |
http_resp_body_offset | Get body start offset. |
http_resp_body_len | Get body length. |
http_build_get_request | Build a GET request. Returns total length in out. |
Details
_hcli_byte_at
fn _hcli_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_hcli_copy
fn _hcli_copy(dst: &i8, doff: i64, src: &i8, soff: i64, len: i64) -> i64Internal: copy bytes.
_hcli_parse_int
fn _hcli_parse_int(buf: &i8, off: i64, len: i64) -> i64Internal: parse integer from ASCII digits at position.
_hcli_find_body
fn _hcli_find_body(buf: &i8, len: i64) -> i64Internal: find double CRLF. Returns offset of body start or -1.
_hcli_lower
fn _hcli_lower(ch: i64) -> i64Internal: compare bytes case-insensitively.
_hcli_eq_nocase
fn _hcli_eq_nocase(a: &i8, aoff: i64, b: &i8, boff: i64, len: i64) -> i64http_parse_response
fn http_parse_response(buf: &i8, len: i64) -> &i64Parse an HTTP response. Returns handle.
http_resp_status
fn http_resp_status(h: &i64) -> i64Get status code.
http_resp_header
fn http_resp_header(h: &i64, name: &i8, nlen: i64, out: &i8) -> i64Get a header value. Searches for “Name: value\r\n”. Returns length of value copied to out, or -1 if not found.
http_resp_body_offset
fn http_resp_body_offset(h: &i64) -> i64Get body start offset.
http_resp_body_len
fn http_resp_body_len(h: &i64) -> i64Get body length.
http_build_get_request
fn http_build_get_request(host: &i8, hlen: i64, path: &i8, plen: i64, out: &i8) -> i64Build a GET request. Returns total length in out.