Skip to main content

fetch

Function fetch 

Source
pub async fn fetch(client: &Client, iri: &str) -> Result<String, Error>
Expand description

Fetch the context iri names, as JsonLdHelper#load_jsonld_context requests one: a GET asking for MEDIA_TYPE, taken only when it answers 200 with that type, its body at most MAX_CONTEXT_BYTES and at most the client’s own limit. What comes back is the body, which Mastodon keeps as it came.

§Errors

When the IRI is not one to fetch, the client refuses it or fails, or the response is not a context by those rules.