我正在使用计划脚本和http.get方法,但会由于“无法在对象中找到函数”而引发错误。代码快照:
var headers_= []
headers_["Content-Type"] = "application/x-www-form-urlencoded";
headers_["Accept"] = "appli`enter code here`cation/json";
headers_["cache-control"] = "no-cache";
var response = http.get({
url: URL_,
headers: headers_
});
检查您的define
语句。应该是:
define(["N/http"], function (http) {
...
});
如果还存在其他依赖关系,请仔细检查数组中依赖关系的顺序是否与回调中参数的顺序完全匹配。
如果顺序完全匹配,请确保用于http模块的参数名称中没有错字。