Liking cljdoc? Tell your friends :D

dk.simongray.wary-fetch.headers

The values of HTTP headers as data: the header maps of responses, links, byte ranges, the If-Range that resumes a download, and when to ask again.

A map of headers has lower-case names, and each value is a string or a vector of strings.

The values of HTTP headers as data: the header maps of responses, links,
byte ranges, the If-Range that resumes a download, and when to ask
again.

A map of headers has lower-case names, and each value is a string or a
vector of strings.
raw docstring

byte-rangesclj/s

(byte-ranges s)

The byte ranges that the Range header value s asks for, as RFC 9110, section 14.1.2, reads them. Nil when s doesn't read, because a server then ignores it.

A value such as bytes=0-1023, 5000- asks for two ranges. A range is a pair of its start and its end, with the end included, or nil for the rest of the file. A nil start and an end of n ask for the last n bytes.

The byte ranges that the Range header value `s` asks for, as RFC 9110,
section 14.1.2, reads them. Nil when `s` doesn't read, because a server
then ignores it.

A value such as bytes=0-1023, 5000- asks for two ranges. A range is a
pair of its start and its end, with the end included, or nil for the
rest of the file. A nil start and an end of n ask for the last n
bytes.
sourceraw docstring

complete-lengthclj/s

(complete-length s)

The size of the whole file that the Content-Range header value s names, or nil when it names none.

It reads both forms of the header: that of a 206, e.g. bytes 0-1023/146515, and that of a 416, e.g. bytes */146515.

The size of the whole file that the Content-Range header value `s`
names, or nil when it names none.

It reads both forms of the header: that of a 206, e.g. bytes
0-1023/146515, and that of a 416, e.g. bytes */146515.
sourceraw docstring

content-rangeclj/s

(content-range s)

The byte range and the size of the whole file that the Content-Range header value s names, e.g. bytes 0-1023/146515, as a map of :start, :end and :total.

It's nil when s doesn't read, and the :total is nil when the server doesn't know the size.

The byte range and the size of the whole file that the Content-Range
header value `s` names, e.g. bytes 0-1023/146515, as a map of :start,
:end and :total.

It's nil when `s` doesn't read, and the :total is nil when the server
doesn't know the size.
sourceraw docstring

gzipped?clj/s

(gzipped? headers)

Whether the response with headers says that its body is gzipped.

Whether the response with `headers` says that its body is gzipped.
sourceraw docstring

(header headers header-name)

The first value of header-name in the response headers map headers, whose values are strings or vectors of them.

The first value of `header-name` in the response headers map `headers`,
whose values are strings or vectors of them.
sourceraw docstring

if-rangeclj/s

(if-range headers)

The If-Range value that resumes the representation of an earlier answer with headers, or nil when the answer has no strong validator.

The value is the entity tag, unless that's weak, and without an entity tag the Last-Modified, when it's at least a second before the Date.

The If-Range value that resumes the representation of an earlier answer
with `headers`, or nil when the answer has no strong validator.

The value is the entity tag, unless that's weak, and without an entity
tag the Last-Modified, when it's at least a second before the Date.
sourceraw docstring

joinedclj/s

(joined headers header-name)

All the values of header-name in the response headers map headers, joined by commas as fetch joins them, or nil for none.

All the values of `header-name` in the response headers map `headers`,
joined by commas as fetch joins them, or nil for none.
sourceraw docstring

(links headers)

The links of the Link header in the response headers, as section 3 of RFC 8288 defines them.

Each link is a map with its target as :href, and with its parameters by name, e.g. :rel and :type. The links are in the order of the header. The first value of a parameter counts, and a target can be relative to the URL of the response.

The links of the Link header in the response `headers`, as section 3
of RFC 8288 defines them.

Each link is a map with its target as :href, and with its parameters
by name, e.g. :rel and :type. The links are in the order of the header.
The first value of a parameter counts, and a target can be relative to
the URL of the response.
sourceraw docstring

not-beforeclj/s

(not-before headers at)
(not-before headers at {:keys [max-wait-seconds] :as opts})

The earliest instant to ask again, by the response headers that arrived at at, with the wait capped at the :max-wait-seconds of opts.

The instant comes from the first of these that the headers give: the Retry-After, the max-age of Cache-Control less the Age, or the Expires. It's nil when they name no later time or forbid a cache. A date counts from the Date of the response so that a wrong clock on the server doesn't matter (RFC 9111, section 4.2.1).

The earliest instant to ask again, by the response `headers` that
arrived at `at`, with the wait capped at the :max-wait-seconds of `opts`.

The instant comes from the first of these that the headers give: the
Retry-After, the max-age of Cache-Control less the Age, or the Expires.
It's nil when they name no later time or forbid a cache. A date counts
from the Date of the response so that a wrong clock on the server
doesn't matter (RFC 9111, section 4.2.1).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close