我正在尝试从rainforestqa API获取数据,但为了获得访问权限,我需要将我的api_key作为标题发送.我已经拥有的代码如下,
var header = {
"access-control-allow-headers":"Content-Type",
"CLIENT_TOKEN" : "API-TOKEN"
};
var options = {
"method" : "post",
"header" : header
};
UrlFetchApp.fetch("https://app.rainforestqa.com:443/api/1/runs/TESTNUMBER/tests.json?result=failed", options);
Run Code Online (Sandbox Code Playgroud)
但是这会返回405错误.有没有人有任何想法为什么这不起作用?
谢谢