Skip to main content
Best answer

Custom webhook: Content-Length and Host headers


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

 

View original
Did this topic help you find an answer to your question?

5 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi @turis 

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

 


  • Author
  • Beginner
  • 2 replies
  • March 9, 2021

What values should I put there?


Troy Tessalone
Forum|alt.badge.img+14

Hi @turis 

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


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30752 replies
  • 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
  • 2 replies
  • 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.