Skip to content

Instantly share code, notes, and snippets.

@siteslave
Created March 29, 2021 07:18
Show Gist options
  • Save siteslave/928ff0a0a0f45a266ddd7d06754042fd to your computer and use it in GitHub Desktop.
Save siteslave/928ff0a0a0f45a266ddd7d06754042fd to your computer and use it in GitHub Desktop.
search(cid: any, token: any) {
var options = {
method: 'GET',
url: 'http://203.157.103.178/api/v1/search/' + cid,
headers: {
Authorization: 'Bearer ' + token
}
};
return new Promise((resolve: any, reject: any) => {
axios.request(options).then(function (response: any) {
resolve(response.data);
}).catch(function (error: any) {
reject(error);
});
});
}
// เวลาเรียก
var res: any = await search("xxxxx", "exxxxxx.xxxx.xxx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment