Overview
Summary
EndpointRequest is an ease of use wrapper around the Data (request/response) delivery mechanism of the platform.
Methods
static Definition(url: string)
Defines EndpointRequest with a url and other parameters.
Parameters:
Property | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
url | No | - | string | The Url represents the address of the endpoint |
Returned value: EndpointRequestDefinition
static Definition(params: EndpointRequestDefinitionParams)
Defines EndpointRequest with a url and other parameters.
EndpointRequestDefinitionParams properties
Property | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
url | No | - | string | The Url presents the address of the endpoint |
method | Yes | 'GET' | enum | Defines the method of the request. Valid methods are: GET, POST, PUT and DELETE |
query | Yes | - | `{[key:string]:string | number |
body | Yes | - | {[key:string]:any} |
Defines the body used to apply to the request |
path | Yes | - | {[key:string]:any} |
Defines the path variables used to apply to the request |
headers | Yes | - | `[header:string]:number | string |
handleAutoRedirect | Yes | true | boolean | Notify the HTTP client to handle all HTTP Redirects automatically or not |
Returned value: EndpointRequestDefinition
Example of usage
session
.open()
.then(() => EndpointRequest.Definition('data/historical-pricing/v1/views/events/IBM').getData(session))
.then(data => /*handle received data*/)
.catch(err => /*handle error*/)
.then(() => session.close());