Interface JsonRequestOptions

Options for JSON requests.

interface JsonRequestOptions {
    skipAcceptHeader?: boolean;
    skipContentTypeHeaderValidation?: boolean;
    skipFailOnErrorCode?: boolean;
}

Hierarchy (view full)

Properties

skipAcceptHeader?: boolean

By default the header "Accept: application/json" is added to a JSON request, if no Accept header is set. Set this flag to skip this.

skipContentTypeHeaderValidation?: boolean

By default response Content-Type header is checked to contain "application/json", and an error is thrown if it is missing. Set this flag to skip this validation.

skipFailOnErrorCode?: boolean

By default, status codes >= 400 are treated as errors, other than in standard fetch. This can be disabled and the standard fetch behaviour restored, by setting this flag.