Private
_optionsPrivate
configPrivate
Readonly
querySet the raw body on the request. This could be as simple as a string, or as complex as a stream.
the raw body to be set on the request
the builder object, for chaining
Make a DELETE request
a url pathname
the builder object, for chaining
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.
options which will be passed directly to fetch
the builder object, for chaining
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
a JSON-like object to be encoded as form data on the request
the builder object, for chaining
Make a GET request
a url pathname
the builder object, for chaining
Make a HEAD request
a url pathname
the builder object, for chaining
Sets a key/value pair as a header on the request.
the header key, e.g. 'Content-Type'
the header value, e.g. 'text/plain'
the builder object, for chaining
Encodes a value as JSON and sets it as the body of the request, along with setting the Content-Type header to application/json
a JSON-stringifiable value to be encoded as JSON on the request
the builder object, for chaining
Make an OPTIONS request
a url pathname
the builder object, for chaining
Private
parseMake a PATCH request
a url pathname
the builder object, for chaining
Make a POST request
a url pathname
the builder object, for chaining
Make a PUT request
a url pathname
the builder object, for chaining
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.
an object representing the query params to be stringified and set on the request
the builder object, for chaining
const runner = microtest('http://localhost:3000', {
queryParser: (paramsObject) => 'custom parser logic'
})
Private
setPrivate
toGenerated using TypeDoc
Fluent-style API for building up HTTP requests.