Skip to main content
Best answer

Custom webhook: Content-Length and Host headers

  • March 9, 2021
  • 5 replies
  • 1025 views

Hi,

Looks like Custom request webhook does not automatically include “Content-Length” and/or “Host” headers. However, when I use GET/POST or PUT request (not custom request), looks like the headers are included, but I cannot use them as I need custom request body because I am working with GraphQL API.

 

How do I add “Content-Length” and/or “Host” headers to “Custom request” Webhook?

 

Thanks!

Richard

Best answer by Troy Tessalone

@turis 

Also I’ve used POST request with Graph QL before, not via the Custom Method option.

Example with Monday.com

 

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

5 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • March 9, 2021

Hi @turis 

Try using the Headers section at the bottom of the Webhooks action step

 


  • Author
  • Beginner
  • March 9, 2021

What values should I put there?


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • March 9, 2021

Hi @turis 

That’s generally indicated by the API you’re sending data to.


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • Answer
  • March 9, 2021

@turis 

Also I’ve used POST request with Graph QL before, not via the Custom Method option.

Example with Monday.com

 


  • Author
  • Beginner
  • March 9, 2021

Thanks! The problem was that the GraphQL queries should always contain “query” and “variables” fields on the top level, I didn’t know that so the request was malformed. The `Content-Length` and `Host` belong to the headers that cannot be modified and are added automatically by the client (according to fetch standard: https://fetch.spec.whatwg.org/#forbidden-header-name)

 

Thanks again for your answers, this thread can be closed.