728x90
반응형
var ItemJSON;
ItemJSON = '{"b_no": ["'+bNo+'"]}';
console.log("ItemJSON",ItemJSON)
URL = "http://api.odcloud.kr/api/nts-businessman/v1/status?serviceKey=발급받은서비스키"; //Your URL
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
xmlhttp.open("POST", URL, false);
xmlhttp.setRequestHeader("Content-Type", "application/json");
// xmlhttp.setRequestHeader('Authorization', 'Basic ' + window.btoa('apiusername:apiuserpassword')); //in prod, you should encrypt user name and password and provide encrypted keys here instead
xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
xmlhttp.send(ItemJSON);
console.log(xmlhttp.responseText);
728x90
반응형
'프로그램 > 자바스크립트' 카테고리의 다른 글
fetch 파일다운로드 (0) | 2023.07.12 |
---|
댓글