SPHttpClientCommonConfiguration class
Common base class for SPHttpClientConfiguration and SPHttpClientBatchConfiguration.
- Extends
Constructors
(constructor)(flags, override |
Constructs a new instance of SPHttpClientCommonConfiguration with the specified flags. |
Properties
flags | |
json |
Automatically configure the "Content-Type" header for a JSON payload. |
json |
Automatically configure the "Accept" header for a JSON payload. |
Constructor Details
(constructor)(flags, overrideFlags)
Constructs a new instance of SPHttpClientCommonConfiguration with the specified flags.
constructor(flags: ISPHttpClientCommonConfiguration, overrideFlags?: ISPHttpClientCommonConfiguration);
Parameters
- overrideFlags
- ISPHttpClientCommonConfiguration
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
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
- sourceFlags
- ISPHttpClientCommonConfiguration