Skip to content

module

http

Transport-independent HTTP: integrations build Requests and parse Responses; the browser (weft::web::fetch) or a server (weft_api::send) does the sending.

Structs

Enums

Functions

decode

pub fn decode(s: &str) -> String

Decode %XX and + (as space).

encode

pub fn encode(s: &str) -> String

Percent-encode a query component (RFC 3986 unreserved characters pass).

error_message

pub fn error_message(body: &str) -> String

The most useful message in an error body (message, error_description, error.message, FHIR issue[0].diagnostics, …), else the body itself.

parse_query

pub fn parse_query(q: &str) -> Vec<(String, String)>

Parse a=1&b=two into decoded pairs.

trim_base

pub fn trim_base(url: &str) -> String

https://x.y/ → https://x.y (so paths can be appended with /).

with_query

pub fn with_query(base: &str, pairs: &[(String, String)]) -> String

base plus ?k=v&… (pairs are encoded; empty values are kept).