The middlewares to be layered over the resolved fetch client, in request processing order
A task converting a feed of requests into a feed of responses
Error While the feed is consumed, if no execution is running, as the fetch client is resolved from the enclosing one
Error While the feed is consumed, whatever the source reports while producing requests, or whatever the exchange reports while connecting to a resource or receiving its response
Creates a resource fetcher.
The generated task converts a feed of requests into a feed of Response objects, so that a consumer draws on remote and local resources through the client the execution supplies rather than through one of its own.
A request is given as the standard
fetch()function accepts it, that is as a URL string, a URL object or a Request object. A response is emitted as soon as its head is received, with the body left unread for the consumer to draw or discard; a response carrying no body is emitted all the same.Exchanges are routed through the fetch client resolved from the enclosing execution, so that the transport is chosen when the task is run rather than by the task itself: binding createFetch routes every exchange through a throttled, cached or stubbed client, without altering the task, while an unbound execution falls back on the standard
fetchfunction.Exchanges are sent under desktop browser
User-AgentandAcceptfields, so that sites serving unattended clients differently, or refusing them altogether, are scraped as a browser would be; a request already stating one of these fields keeps its own value, as do the ones stated bymiddlewares.Content coding is left to the transport, which states the codings it accepts and decodes the body before it reaches the consumer, so that no
Accept-Encodingfield is stated here and no body is handed over still compressed.Every exchange is reported to the log as it is performed, so that a run leaves a trace of the resources it drew on and of the ones it was denied; requests are reported as they are stated, before
middlewaresare given a chance to alter them.middlewaresand the resolved client carry across exchanges.A request stating a URL that is not absolute, or malformed in any other way, is dropped before it is sent, as is a response stating an unsuccessful status; both are reported to the log, leaving the feed to run to completion.