Resets any conditions in the method chain set by when
the factory instance
Creates a HTTPRequest with configuration based on the given APIConfig's name and endpoint name.
It also populates the request's meta with info about the API and endpoint inside request.meta.api
merging in any meta defined in the api config's api.meta
and endpoint.meta
.
Rest
...args: [string, string] | [string]The created request.
Factory method for creating DELETE requests
Factory method for creating GET requests
Factory method for creating POST requests
Factory method for creating PUT requests
Adds a condition for the application of method-chain settings. It can be reset by calling always
A function that takes a HTTPRequest object and returns whether or not to apply the condition.
Adds the specified MIME types to the accept header to the factory defaults.
Rest
...mimeTypes: string[]An array of MIME types to be added to the accept header.
the factory instance
Adds APIConfig configurations that can be consumed by calling createAPIRequest.
the factory instance
Sets the credentials policy for the factory defaults.
The credentials policy to be set.
the factory instance
Rest
...interceptors: ErrorInterceptor[]Adds the specified header to the factory defaults.
The key of the header.
The value of the header.
the factory instance
Adds the provided headers to the factory defaults.
The headers to be added to the request.
the factory instance
Sets the logger adapter for the instance for every request created.
By default the logger will be set by the factory to the internal ConsoleLogger
adapter.
The logger to set.
the factory instance
Sets the log level to the factory defaults.
The log level to be set.
the factory instance
Adds a request interceptor to the request configuration. Interceptors are executed in the order they are added.
undefined
, the request will continue to the next interceptor, if present or to the regular request handlingRest
...interceptors: RequestInterceptor[]Adds a response body transformer to the factory defaults.
Rest
...transformers: ResponseBodyTransformer[]the factory instance
A factory for creating HTTPRequest instances. It can be configured with defaults, logging options as well as conditional settings using when in a method-chain fashion.