Function: configureRequest()
configureRequest(
nextConfig
): <C
>(action
) =>Promise
<Action
<Awaited
<C
> &object
,object
>>
Configure an HTTP request used by the HttpAdapter (see makeHttpAdapterWith).
Some configuration options will be merged when possible (object query params,
headers, transformers, etc.).
This enhancer can be used to configure a full request object or preconfigure
some common options (e.g. headers and transformers).
Passing a Fetch request object
as request
option will ignore any other configuration and request
object will be directly passed to the adapter. Transformers will still be
applied, but other automatic transformation or data passing (params, body, etc.)
won't be applied.
Parameters
• nextConfig: HttpRequestConfig
Returns
Function
Type parameters
• C extends object
Parameters
• action: Action
<C
>
Returns
Promise
<Action
<Awaited
<C
> & object
, object
>>
Source
packages/http/src/actions/context/enhancers/configureRequest.ts:51