-
-
Notifications
You must be signed in to change notification settings - Fork 16
HTTP Request
Namhyeon, Go edited this page Mar 4, 2022
·
1 revision
var HTTP = require("lib/http");
var credential = {
"email": document.getElementById("txt_email").value,
"password": document.getElementById("txt_password").value
};
HTTP.create()
.setContentType("application/json")
.setRequestBody(credential)
.post(apiUrl + "myproject/auth/authenticate", function(res) {
if ("error" in res) {
console.error(res.error.message);
} else if ("data" in res) {
console.log(res.name);
}
})
;
var HTTP = require("lib/http");
HTTP.create()
.setContentType("application/x-www-form-urlencoded")
.setBearerAuth(token)
.setUseCache(false)
.get(apiUrl + "myproject/items/mycollection", function(res) {
if ("error" in res) {
console.error(res.error.message);
} else if ("data" in res) {
console.log(res.name);
}
})
;
This document may contain outdated content. For the latest information, please contact us directly or refer to the webpage below.