WHATWG Fetch implementation for Bare.
npm i bare-fetch
const fetch = require('bare-fetch')
const res = await fetch('https://api.restful-api.dev/objects/7')
console.log(await res.text())
The response headers.
The HTTP status code of the response.
Whether or not the request has been redirected to a different URL.
The response body stream.
Whether or not the stream has already been consumed.
Consumes the stream and returns a Buffer
.
Consumes the stream and returns a Uint8Array
.
Consumes the stream and returns an ArrayBuffer
.
Consumes the stream and returns a UTF-8 string.
Consumes the stream and returns a JSON value.
Apache-2.0