Constructor
new OpenSearchRequest(options)
Constructs a request object with the specified options.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
Members
(static) defaultOptions
Internal. Applications should not modify these values.
Default values for an OpenSearchRequest
body :FormData|Object
Payload data for POST, PUT requests.
Type:
- FormData | Object
encType :String
A valid encoding for POST, PUT requests.
Type:
- String
headers :Object
Request headers.
Use the addHeader method.
Type:
- Object
method :String
A valid http method.
Type:
- String
password :String
Password for authentication purposes.
Type:
- String
relation :String
A valid open search rel. Possible values are 'collection' or 'results'.
Type:
- String
responseType :String
The response type for XHR.
Type:
- String
timeout :Number
A timeout in milliseconds for the ajax request.
Type:
- Number
type :String
A valid mime type.
Type:
- String
url :String
Url for a resource such as a description document.
Type:
- String
user :String
Username for authentication purposes.
Type:
- String
withCredentials :Boolean
A flag to indicate if the request should include credentials.
Type:
- Boolean
Methods
addHeader(name, value)
Adds a header to an OpenSearchRequest request object
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the header |
value |
String | The value of the header |
getHeader(name) → {String|undefined}
Gets the value of a header
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the header |
Returns:
The value of the header or undefined if the header does not exist
- Type
- String | undefined