WIP: initial prototype
- Do not serilize keys with undefined values in querystring - Added promises support in Transport.request
This commit is contained in:
@ -34,10 +34,21 @@ class Transport {
|
||||
}
|
||||
|
||||
request (params, options, callback) {
|
||||
options = options || {}
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
// promises support
|
||||
if (callback == null) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.request(params, options, (err, result) => {
|
||||
err ? reject(err) : resolve(result)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
callback = once(callback)
|
||||
// TODO: return in the result the metadata
|
||||
const meta = {
|
||||
|
||||
Reference in New Issue
Block a user