Options
All
  • Public
  • Public/Protected
  • All
Menu

External module frest-json

Index

Type aliases

IJSONTransformFn

IJSONTransformFn: function

Response transformation function signature.

param

The fetch response object.

returns

string promise

Type declaration

    • (response: Response): Promise<string>
    • Parameters

      • response: Response

      Returns Promise<string>

Variables

Const ID_ERROR

ID_ERROR: "json:error" = "json:error"

Identifier of JSON error interceptor function.

Const ID_REQUEST

ID_REQUEST: "json:request" = "json:request"

Identifier of JSON request interceptor function.

Const ID_RESPONSE

ID_RESPONSE: "json:response" = "json:response"

Identifier of JSON response interceptor function.

Functions

errorInterceptor

  • Create a JSON error interceptor.

    remarks

    In Frest, any kind of error, including non-OK HTTP status, during request life-cycle will be thrown. This interceptor will try to parse response body in case the request is completed but with non-OK HTTP status AND it specifies the Content-Type header is compatible with application/json or the one specified in the options.

    Parameters

    Returns IErrorInterceptor

    JSON error interceptor function

jsonInterceptors

  • Create JSON interceptors set.

    remarks

    Specify an option for each type of interceptor to enable them. Unspecified option will make the interceptor not created.

    Parameters

    Returns IInterceptors

requestInterceptor

responseInterceptor

Generated using TypeDoc