Fetches a URL with an HTTP GET, in the shape the framework's providers call.
A 2xx answers with null and the body. Any other status answers with http <status> and the body,
so a provider still reads its own error JSON and a 429 still reads as a rate limit. A fetch given
up after the timeout answers timeout. A fetch refused before it left, for a site the wearer has
not allowed, answers NETWORK_ERROR, and any other failed fetch answers FETCH_FAILED, with no
body in each case. A body that cannot be read after the host answered gives a non-2xx's status with
no body, and FETCH_FAILED after a 2xx.
Only NETWORK_ERROR is known never to have reached the provider, so only it takes a stamp back.
Param: url
The address to fetch.
Param: callback
Called once with an error, or with null and the body.
Fetches a URL with an HTTP GET, in the shape the framework's providers call.
A 2xx answers with null and the body. Any other status answers with
http <status>and the body, so a provider still reads its own error JSON and a 429 still reads as a rate limit. A fetch given up after the timeout answerstimeout. A fetch refused before it left, for a site the wearer has not allowed, answersNETWORK_ERROR, and any other failed fetch answersFETCH_FAILED, with no body in each case. A body that cannot be read after the host answered gives a non-2xx's status with no body, andFETCH_FAILEDafter a 2xx. OnlyNETWORK_ERRORis known never to have reached the provider, so only it takes a stamp back.