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.