import XHRRequestAdapter from '@pageproof/sdk/src/adapters/XHRRequestAdapter.js'
XHRRequestAdapter
Extends:
IRequestAdapter → XHRRequestAdapter
The XMLHttpRequest request adapter (browsers only).
Unlike other IRequestAdapters, this one has an option for async
. By default the async
option is enabled
by default, to prevent multiple requests from blocking eachother.
Example:
import PageProof from '@pageproof/sdk';
import XHRRequestAdapter from '@pageproof/sdk/lib/xhr-request-adapter';
const client = new PageProof({
adapters: [
new XHRRequestAdapter({
applicationId: '3uQkbQXsinffvnNHPlplx4Uw1sVeWEab',
endpoint: 'https://managed-api.pageproof.com',
key: '104882dfa7c44330811612ea100dc7e6',
async: true,
}),
],
});
Constructor Summary
Public Constructor | ||
public |
constructor(options: object) |
Member Summary
Public Members | ||
public |
options: * |
Method Summary
Public Methods | ||
public |
send(request: *, options: {}): * |
Inherited Summary
From class IRequestAdapter | ||
public abstract |
send() |
Public Constructors
public constructor(options: object) source
Params:
Name | Type | Attribute | Description |
options | object | ||
options.applicationId | string | The application identifier (32 characters) |
|
options.endpoint | string | The endpoint to send API requests to |
|
options.key | string |
|
The subscription key |
options.async | boolean |
|
Whether to send request asynchronously |
Public Members
public options: * source
Public Methods
public send(request: *, options: {}): * source
Override:
IRequestAdapter#sendParams:
Name | Type | Attribute | Description |
request | * | ||
options | {} |
|
Return:
* |