Reputation: 1
I'm using schedule script and http.get method but throws error as "Cannot find function get in object". code snapshot:
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_
});
Upvotes: 0
Views: 517
Reputation: 8857
Check your define
statement. It should be:
define(["N/http"], function (http) {
...
});
If there are other dependencies as well, double-check that the order of the dependencies in the Array matches exactly the order of the parameters in the callback.
If the order matches exactly, make sure you don't have a typo in the parameter name you use for the http module.
Upvotes: 0