I'm testing with Postman to connect to a customer....
# suitescript
s
I'm testing with Postman to connect to a customer. I get the token and put it in bearer. It's working fine with Postman but I don't really know how to do it with Netsuite. I get the token, then pass the token to "bearer" like this var _headers = { }; _headers["Authorization"] = 'Bearer ' + access_token; //???? _headers["Content-Type"] = "application/json"; Anyone of you have an idea how to pass "bearer" and the access code ?
b
looks reasonable to generate a header to be used N/https
for the code you have, its probably best to use an Object initializer
n
@battk isn't {} fine? Google recommends using this instead of new Object()
Or are you referring to just add the key values right away?
b
Copy code
const object1 = { a: 'foo', b: 42, c: {} };
👍 1