Class: OpenSearchRequest

OpenSearchRequest(options)

Object representing an OpenSearch request.

Constructor

new OpenSearchRequest(options)

Constructs a request object with the specified options.
Parameters:
Name Type Description
options Object
Source:

Members

(static) defaultOptions

Internal. Applications should not modify these values. Default values for an OpenSearchRequest
Source:

body :FormData|Object

Payload data for POST, PUT requests.
Type:
  • FormData | Object
Source:

encType :String

A valid encoding for POST, PUT requests.
Type:
  • String
Source:

headers :Object

Request headers. Use the addHeader method.
Type:
  • Object
Source:

method :String

A valid http method.
Type:
  • String
Source:

password :String

Password for authentication purposes.
Type:
  • String
Source:

relation :String

A valid open search rel. Possible values are 'collection' or 'results'.
Type:
  • String
Source:

responseType :String

The response type for XHR.
Type:
  • String
Source:

timeout :Number

A timeout in milliseconds for the ajax request.
Type:
  • Number
Source:

type :String

A valid mime type.
Type:
  • String
Source:

url :String

Url for a resource such as a description document.
Type:
  • String
Source:

user :String

Username for authentication purposes.
Type:
  • String
Source:

withCredentials :Boolean

A flag to indicate if the request should include credentials.
Type:
  • Boolean
Source:

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
Source:

getHeader(name) → {String|undefined}

Gets the value of a header
Parameters:
Name Type Description
name String The name of the header
Source:
Returns:
The value of the header or undefined if the header does not exist
Type
String | undefined