Hi all anybody know how to send request header par...
# suitescript
d
Hi all anybody know how to send request header parameters for client_id and client_profile_id while calling avalara communication tax calculation API?
b
as in you dont know how to set headers?
or you dont know how to set those specific headers?
d
Battl I know how to pass it but it's not working
When I am sending this from postman it is
var Avalara_headerObj = {                             "Authorization": 'Basic *xxxxxxxxxxxxx',                             "client_id":783,                             "client_profile_id":1,                             "Content-Type":'application/json',                             "User-Agent-x": 'SuiteScript-Call'                 }
I am setting like this but it is not working
b
that looks good to me, what does your error look like
and what does the rest of your N/https parameters look like
d
var response = https.post({ url: data.rest_api_url, body: cnfg_str, headers: Avalara_headerObj })
While passing parameters does netsuite remove some of the headers parameters?
b
you can check using an echo service like httpbin.org
d
I will check thank you so much
I have checked and I think netsuite is not allowing them go further
In postman I can see that is coming but
Via netsuite it is not
s
@DATTA i'd check if it's https/http, and also the url called, sometimes that could make a difference. And maybe for the header auth, change all you values to string types?
b
change the url of your postman request to https://httpbin.org/post
change the url of your N/https request to https://httpbin.org/post
compare the 2 to see the differences
d
Sure I will
Check in postman and script
In postman I can see that parameters
But in script log I can't see that both parameters
b
try making sure all your headers are strings
d
Thank you @battk you are really great man
Appreciated
Thank you @Sciuridae54696d too
keanu thanks 1
It is passing now
The problem is with I am passing number and I did include that in single quote