Expand description
Fetching from the web: the one client everything is fetched with, and the one way of fetching.
Every address comes from whoever wrote a profile or a note. Only https
is fetched, redirects included; nothing waits longer than
FETCH_TIMEOUT; and no more is read than the caller is ready to keep,
so a hostile address costs a refused request at worst. Of a web page
only the head is read, and that only if the server calls it a page.
Videos are the one thing fetched that is not fetched here: see
crate::video.
Structs§
- Page
Head - The head of a web page: where it was found, after whatever redirects, and its bytes as far as they were read.
Enums§
- Linked
- What a link turned out to be, asked for as a web page.
Constants§
- FETCH_
TIMEOUT 🔒 - How long anything gets to arrive.
Functions§
- client
- The HTTP client:
httpsonly, redirects included, and never waiting longer thanFETCH_TIMEOUT. - get
- What is at
url, if it answers with success and is no more thanmax_byteslong. - get_as
- What
urlanswers when it is asked foraccept, up tomax_bytes: a relay’s account of itself, say, which is at the relay’s own address for whoever asks for that and not for a page. - get_
in_ place - As
get, of an address that has to answer for itself: what came from anywhere it sent the request on to is refused. - get_
page_ head - The head of the web page at
url: what it sends until its head ends, andmax_bytesof it at most. Unlikeget, a page longer than that is no error: the rest is left unread. What the server doesn’t call a web page is refused before any of it is read; if it calls it a video, that is the answer. - head_
end 🔒 - Where the head of a page ends in
bytes, looking fromfromon: at the tag that closes it, or the one that opens the body. - is_html 🔒
- Whether what a server calls
content_typeis a web page. - is_
video - Whether what a server, or a note, calls
content_typeis a video. - media_
type 🔒 - The media type in what a server calls
content_type, without what follows it. - read 🔒
- What
responsecarries, if it is a success and no more thanmax_byteslong.