SPHttpClientCommonConfiguration class

Common base class for SPHttpClientConfiguration and SPHttpClientBatchConfiguration.

Extends

Constructors

(constructor)(flags, overrideFlags)

Constructs a new instance of SPHttpClientCommonConfiguration with the specified flags.

Properties

flags
jsonRequest

Automatically configure the "Content-Type" header for a JSON payload.

jsonResponse

Automatically configure the "Accept" header for a JSON payload.

Methods

initializeFlags()
overrideWith(sourceFlags)

Constructor Details

(constructor)(flags, overrideFlags)

Constructs a new instance of SPHttpClientCommonConfiguration with the specified flags.

constructor(flags: ISPHttpClientCommonConfiguration, overrideFlags?: ISPHttpClientCommonConfiguration);

Parameters

Remarks

The default values will be used for any flags that are missing or undefined. If overrideFlags is specified, it takes precedence over flags.

Property Details

flags

protected flags: ISPHttpClientCommonConfiguration;

Property Value

jsonRequest

Automatically configure the "Content-Type" header for a JSON payload.

get jsonRequest(): boolean;

Property Value

boolean

Remarks

When this switch is true:

If the "Content-Type" header was not explicitly added for the request, then SPHttpClient will add it if the request is a write operation (i.e. an HTTP method other than "GET", "HEAD", or "OPTIONS").

For OData 3.0, the value is 'application/json;odata=verbose;charset=utf-8'.

For OData 4.0, the value is 'application/json;charset=utf-8'.

jsonResponse

Automatically configure the "Accept" header for a JSON payload.

get jsonResponse(): boolean;

Property Value

boolean

Remarks

When this switch is true:

If the "Accept" header was not explicitly added for the request, then SPHttpClient will add it.

For OData 3.0, the value is 'application/json'.

For OData 4.0, the value is 'application/json;odata.metadata=minimal'.

Method Details

initializeFlags()

/** @override */
protected initializeFlags(): void;

Returns

void

overrideWith(sourceFlags)

/** @override */
overrideWith(sourceFlags: ISPHttpClientCommonConfiguration): SPHttpClientCommonConfiguration;

Parameters

Returns