Skip to main content

Module http

Module http 

Source
Expand description

The calls of a plugin to its service: the HTTP client as Escouade’s network settings make it, and a call whose failure says what the service said (HttpError).

reqwest is what a plugin takes its client from, on both targets: the crate itself in process, in a module the part of it the plugins use, over the host’s net/fetch (fetch).

Re-exports§

pub use ::reqwest;

Structs§

Network
The network as Escouade’s settings say it (Réglages › Réseau), given to a plugin of the first hand when it starts: ESCOUADE_PROXY (empty: none), ESCOUADE_NO_PROXY, ESCOUADE_INSECURE_TLS (1: the certificates are not checked, for a proxy that inspects them without its root in the system’s store). A module has no environment and needs none of it: the host keeps its network.

Functions§

call
send_named’s JSON.
call_page
call, and whether the answer’s Link header points to a next page.
encode
Percent-encoding of everything but the unreserved characters: a path segment or a query value.
host_of
The host of an address (https://Git.Acme.dev:8443/x → git.acme.dev:8443), lowercase: the name of an instance’s account, as the core’s forge::host_of says it.
send_named
Sends a call to the service name: its JSON (null when empty) and its headers. A status other than a success is an HttpError that says what the service said.