From 6996ad504aa5bc5a88d7757be3a7d389801e870d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 19:13:49 +0000 Subject: [PATCH] docs: document default Content-Type header for fetch and webhook steps - Add section explaining default Content-Type: application/json header - Document that users can override the default header - Clarify that no header is added for GET requests or empty bodies - Apply documentation to both fetch function and webhook channel pages Co-Authored-By: Chris Bell --- content/designing-workflows/fetch-function.mdx | 8 ++++++++ content/integrations/webhook/overview.mdx | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/content/designing-workflows/fetch-function.mdx b/content/designing-workflows/fetch-function.mdx index 770640c95..738b30f27 100644 --- a/content/designing-workflows/fetch-function.mdx +++ b/content/designing-workflows/fetch-function.mdx @@ -36,6 +36,14 @@ Aside from the request method selector, each of the above fields is a Liquid-com See the [Knock template editor reference](/send-notifications/designing-workflows/template-editor) for detailed information on working with Liquid templates in Knock. +### Default headers + +When a fetch function includes a request body, Knock automatically adds a `Content-Type: application/json` header to the request. This ensures your endpoint receives properly formatted JSON data with the correct content type. + +You can override this default by explicitly setting your own `Content-Type` header in the headers field. This allows you to use alternative content types (such as `application/xml` or `text/plain`) when needed for your specific use case. + +For `GET` requests or requests without a body, no default `Content-Type` header is added. + ## Request execution When executing the request for a fetch function, Knock expects the following from your service: diff --git a/content/integrations/webhook/overview.mdx b/content/integrations/webhook/overview.mdx index 92808c5e5..111f9b702 100644 --- a/content/integrations/webhook/overview.mdx +++ b/content/integrations/webhook/overview.mdx @@ -69,6 +69,14 @@ To learn how to build a webhook request in detail, you can read [our fetch funct } /> +### Default headers + +When a webhook request includes a request body, Knock automatically adds a `Content-Type: application/json` header to the request. This ensures your endpoint receives properly formatted JSON data with the correct content type. + +You can override this default by explicitly setting your own `Content-Type` header in the headers field. This allows you to use alternative content types when needed for your specific use case. + +For `GET` requests or requests without a body, no default `Content-Type` header is added. + ## Use your webhook channel Once your webhook channel is configured and you've built its webhook request, you're ready to add your webhook channel to a workflow.