Core module with the basic REST functions
- Source:
Methods
(inner) basicRest(options, cb)
Process a request given an options object
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | Options object for the request. (See generateOptions) |
cb |
function | callback to be called when processed the request. |
- Source:
(inner) generateOptions(url, method, headers, obj) → {Objcet}
Generates the options to REQUEST
Return Object
{ url: String,
method: String,
headers: Object,
obj: Object
}
Headers Object
{ 'User-Agent': 'request',
'Content-Type': 'text/html'
}
Parameters:
Name | Type | Description |
---|---|---|
url |
String | the url to be called |
method |
String | method: PUT, POST, DELETE, GET |
headers |
Object | Headers to HTTP Request |
obj |
Object | The body obj, if there is |
- Source:
Returns:
Options object returned
- Type
- Objcet