Expand description
§yttp - “Better HTTP”
A JSON/YAML façade for HTTP requests and responses. Provides header shortcuts, smart auth, content-type-driven body encoding, and structured response formatting.
Structs§
- Request
- Parsed HTTP request, ready to send.
- Response
- Structured response.
- Status
- Structured status.
- UrlParts
- URL components.
Enums§
- Error
- Error type for yttp operations.
Functions§
- append_
query_ to_ url - Append query parameters from a
q:value to a URL string. - build_
query_ string - Build a URL query string from an object of key-value pairs.
- collapse_
headers - Collapse expanded headers back to shortcut form (inverse of expand_headers).
- encode_
body - Encode response body for structured output: JSON → value, UTF-8 → string, binary → base64.
- expand
- Expand yttp shortcuts on a parsed Value.
- expand_
headers - Expand shortcut keys and values in a headers map.
- format_
response - Format a full response as a structured value (s!, h, b).
- from_
json - Deserialize a JSON string into a Value. Fails if the input is not valid JSON.
- from_
str - Deserialize a JSON/YAML string into a Value (auto-detect format).
- from_
yaml - Deserialize a YAML string into a Value. Does not attempt JSON parsing.
- headers_
to_ raw - Build request headers as raw HTTP string.
- parse
- Convenience: deserialize + expand. Equivalent to
expand(from_str(s)?). - parse_
request - Parse a request from a JSON/YAML value, expanding header shortcuts.
- parse_
url - Parse URL into components.
- resolve_
method - status_
inline - Format status as an inline object {v, c, t}.