myFunction () function {
var url = UrlFetchApp.fetch ("https://www.tokopedia.com/freeknight");
var content = url.getResponseCode ();
Logger.log (content);
}
then I try to add the GET method, the results remain the same.
myFunction () function {
var option = {
'method': 'GET'
}
var url = UrlFetchApp.fetch ("https://www.tokopedia.com/freeknight", option);
var content = url.getResponseCode ();
Logger.log (content);
}
out of curiosity, I tried using a POSTMAN and API TESTER with the same method the result of the response is 200, why is that?
Use .getContentText() instead