Created
September 23, 2019 14:14
-
-
Save PamornT/13a5079489c9d0824071499bd3698438 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let promise_track = new Promise(resolve => { | |
var options = { | |
method: 'POST', | |
uri: 'https://trackapi.thailandpost.co.th/post/api/v1/track', | |
strictSSL: false, | |
body: JSON.stringify(params), | |
headers: { | |
'Content-Type': 'application/json', | |
'Authorization': 'Token ' + access_token.token | |
} | |
}; | |
request(options, function(error, response, body) { | |
resolve( JSON.parse(body) ); | |
}); | |
}); | |
let tracks = await promise_track; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment