Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IJSONResponseInterceptorOption

Options for JSON response interceptor factory.

Hierarchy

  • IJSONResponseInterceptorOption

Index

Properties

Optional force

force: undefined | true | false

Force JSON parsing.

remarks

By default this interceptor will only parse JSON response if the Content-Type response header is compatible with application/json or the one specified in headerContent. By setting force to true, it'll parse regardless the header.

Optional headerContent

headerContent: undefined | string

Customize response Content-Type header to enable JSON parsing.

default

"application/json"

Optional transform

transform: IJSONTransformFn

Set transformation function to transform response body to text/string.

remarks

You can modify the response string before JSON.parse process. The function will receive the fetch response and must return a promise of string.

Generated using TypeDoc