RequestHandler
Direct Subclass:
Base request handler for all the API's
with get
, post
, put
and delete
methods
Constructor Summary
Public Constructor | ||
public |
constructor(settings: object) Initialize request handler |
Method Summary
Public Methods | ||
public |
Delete resource |
|
public |
Get resource |
|
public |
Post resource |
|
public |
Put resource |
|
public |
Create new request promise |
|
public |
Set Environment |
|
public |
Set API url |
|
public |
Upload files |
Public Constructors
Public Methods
public delete(path: string, query: object, data: object, headers: object): Promise source
Delete resource
public post(path: string, data: object, query: object, headers: object): Promise source
Post resource
public request(options: object): Promise source
Create new request promise
Params:
Name | Type | Attribute | Description |
options | object | request options. |
public setEnv(env: string) source
Set Environment
Params:
Name | Type | Attribute | Description |
env | string | Environment Type: 'stg', 'hmla', 'hmlb', 'sandbox', 'integration'; |
Example:
var sdk = require('ingresse-sdk');
var ingresse = new Sdk();
// You will have access to this API
// after instantiate the Sdk.
var api = ingresse.api;
// Can set an specific Environment to this API
api.setEnv('integration');
public setUrl(url: string) source
Set API url
Params:
Name | Type | Attribute | Description |
url | string | Base URL, example: 'https://hml-api.ingresse.com' |
Example:
var sdk = require('ingresse-sdk');
var ingresse = new Sdk();
// You will have access to this API
// after instantiate the Sdk.
var api = ingresse.api;
// Can set an specific URL to this API
api.setUrl('https://hml-api.ingresse.com');