Best answer

Custom webhook: Content-Length and Host headers

  • 9 March 2021
  • 5 replies
  • 754 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

icon

Best answer by Troy Tessalone 9 March 2021, 16:15

View original

5 replies

Userlevel 7
Badge +14

Hi @turis 

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

 

What values should I put there?

Userlevel 7
Badge +14

Hi @turis 

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

Userlevel 7
Badge +14

@turis 

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

Example with Monday.com

 

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.

Reply