0
UrlFetchApp를 사용하여 API에서 정보를 가져 오려고합니다. POSTMAN GET 및 POST 명령을 시도하고 잘 작동합니다. Google 애플리케이션 스크립트의 첫 번째는 초기 로그인 요청을 보낼 때, 서버가 세션에 사용되는 쿠키를 반환 작동하고 두 번째 반환 오류 404UrlFetchApp가 404 오류를 반환합니다.
function pru_demo() {
// Log In.
var options = {
'method' : 'POST',
'contentType': 'application/json'
};
var response=UrlFetchApp.fetch('https://demo.erpnext.com/api/method/[email protected]&pwd=demo', options);
var data=JSON.parse(response)
Logger.log(data.full_name);
// Get Employes
options = {
// 'muteHttpExceptions' : true,
'method' : 'GET',
'contentType': 'application/json'
};
response=UrlFetchApp.fetch('https://demo.erpnext.com/api/resource/Employee', options);
Logger.log(response.getContentText());
}
:
나는 이것을 증명하기 위해 코드를 수정했습니다. 매우 감사합니다. –