Terminate these steps if header is a case-insensitive match for one of the following headers:
Learn more about header.
Learn more about header Content Type.
GET Example
var url = "https://example.com";
var res_function = function(res, status) {
if( status == 200){ //ok
var responseText = JSON.parse(res);
// responseText
}
}
var ARGUMENTS = {URL:url, RES_FUNCTION:res_function, HEADER:{'Content-type':'application/json;charset=UTF-8'}};
https(ARGUMENTS);
OPTIONS, PUT, POST, DELETE Example
var url = "https://example.com";
var db = "repositories=https&language=JavaScript";
var res_function = function(res, status) {
if( status == 200){ //ok
var responseText = JSON.parse(res);
// responseText
}
}
var ARGUMENTS = {URL:url, METHOD:'POST', DATA:db, RES_FUNCTION:res_function};
https(ARGUMENTS);
Author
weibo: yakeing
twitter: yakeing