Private
_optionsPrivate
configSet the raw body on the request. This could be as simple as a string, or as complex as a stream.
the builder object, for chaining
the raw body to be set on the request
Make a DELETE request
the builder object, for chaining
a url pathname
Override fetch options directly. This is useful if you want to provide highly customized logic to the underlying request, such as providing an AbortController.
Note that this merges your options directly with the builder's underlying
options, so if, for example, you previously set a header, but now
override headers
, your previous changes will not be reflected in the
request. For this reason, it's strongly recommended to use this method
only for options that are not provided elsewhere on the builder.
the builder object, for chaining
options which will be passed directly to fetch
Encodes an object as form data and sets it as the body of the request, along with setting the Content-Type header to multipart/form-data
the builder object, for chaining
a JSON-like object to be encoded as form data on the request
Make a GET request
the builder object, for chaining
a url pathname
Make a HEAD request
the builder object, for chaining
a url pathname
Sets a key/value pair as a header on the request.
the builder object, for chaining
the header key, e.g. 'Content-Type'
the header value, e.g. 'text/plain'
Encodes a value as JSON and sets it as the body of the request, along with setting the Content-Type header to application/json
the builder object, for chaining
a JSON-stringifiable value to be encoded as JSON on the request
Make an OPTIONS request
the builder object, for chaining
a url pathname
Private
parseMake a PATCH request
the builder object, for chaining
a url pathname
Make a POST request
the builder object, for chaining
a url pathname
Make a PUT request
the builder object, for chaining
a url pathname
Encodes and sets query parameters on the URL. Uses the query parser that the RequestBuilder was intiialized with. To customize how query parameters are parsed, you can pass in a function into the microtest runner configuration.
const runner = microtest('http://localhost:3000', {
queryParser: (paramsObject) => 'custom parser logic'
})
the builder object, for chaining
an object representing the query params to be stringified and set on the request
Private
setPrivate
toGenerated using TypeDoc
Fluent-style API for building up HTTP requests.