Question

How to change user agent in header

  • 6 August 2021
  • 7 replies
  • 1539 views

https://zapier.com/shared/789be8f197749588fa99e66bc8226d58ec277ddc

 

I want to change the default header user-agent set in the header for the webhook I created.

 

Currently by default it is coming as Zapier. 

Headers
connection close
x-datadog-sampling-priority 1
x-datadog-parent-id 14349220914762669886
x-datadog-trace-id 11137347577239804048
content-length 1289
content-type html
accept */*
accept-encoding gzip, deflate
user-agent Zapier
sentry-trace 8bb148fcb94241ddb68740f865517693-ab794d4fa56af9d4-0
host webhook.site

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

7 replies

Userlevel 1
Badge +1

I can’t properly see your Zap for some reason, but you should just be able to hard-code the user agent in the next step? You can add custom headers.

Userlevel 7
Badge +12

Hi @lalitswain - Try setting it as User-Agent instead of user-agent and it should work.

Hi @lalitswain - Try setting it as User-Agent instead of user-agent and it should work.

Thanks , it worked but the issue here is, I wanted to keep user-agent as blank or don't want to send this header in the post. 

If I am putting blank, it is taking default value. ie Zapier

 

is there anyway, can I send it as blank?

I can’t properly see your Zap for some reason, but you should just be able to hard-code the user agent in the next step? You can add custom headers.

Yes, I was adding user-agent and it was not working. I changed to User-Agent and it works now.  I am trying to find a solution where we should not send any User-Agent or as blank. I am not able to figure out how to do it.

 

Thank you

Userlevel 1
Badge +1

Out of curiosity, why does the User-Agent need to be completely blank?

 

Out of curiosity, why does the User-Agent need to be completely blank?

 

for a very specific case. 

 

“As of September, 2017, We recently discovered that if NO User agent is sent, NetSuite will work. Some server side applications are sending a User-Agent (it may not be obvious) and this causes a problem. We also discovered that NetSuite only lets some specific User-Agents in; I don’t have a valid list but it does mean you may need trial and error techniques to get it dialed in. “

 

https://blog.prolecto.com/2014/08/14/anonymous-suitelet-demands-user-agent-header/

Userlevel 7
Badge +12

@lalitswain - That’s probably not possible with the Webhooks by Zapier app.

You might want to use a code block instead. Here’s an example:

const response = await fetch("https://webhook.site/...", {
method: "POST",
headers: {
"User-Agent": "",
},
}).then(response => response.json());

return response;