Duplication of Content-Type when trying to send a API POST request
Hi noticed some weird functionality that I have never seen before and honestly is extremely confusing to me. Not sure if it is a features on not so I thought, I'd mention it here
When trying to send an POST request with the Content-Type explicitly mentioned as application/json and having the body raw JSON I get an error saying 'application/JSON,application/JSON is not supported by this resource'
After a few tests I noticed that it was automatically adding application/JSON as the content type and keeping the value empty fixed the issue and let me proceed with the POST request and 0 errors.
Could anyone offer any insight as to why this happens or if it is a bug because I would have to immediately make these changes for all my clients accordingly


1 Reply
Hey there! š
This is expected behaviour of the API Step, not a bug: ⢠When the request body is set to Raw ā JSON Voiceflow automatically adds the header to the outgoing call. ⢠If you also add a Content-Type row in the Headers table, the request is sent with two values. Most servers concatenate them and you end up with: which many endpoints (including the one youāre calling) reject. ā Fix: simply delete the manual header (or leave the value blank). Voiceflow will continue to send the correct header for you. š Only add your own Content-Type header when you need something other than
Docs for reference: Headers, Body & Parameters section of the API Step ā https://docs.voiceflow.com
This is expected behaviour of the API Step, not a bug: ⢠When the request body is set to Raw ā JSON Voiceflow automatically adds the header to the outgoing call. ⢠If you also add a Content-Type row in the Headers table, the request is sent with two values. Most servers concatenate them and you end up with: which many endpoints (including the one youāre calling) reject. ā Fix: simply delete the manual header (or leave the value blank). Voiceflow will continue to send the correct header for you. š Only add your own Content-Type header when you need something other than
application/json
(e.g. application/x-www-form-urlencoded
, multipart/form-data
, etc.) and make sure the body format matches.
Thatās all you needāno changes are required to clients other than removing the duplicated header.Docs for reference: Headers, Body & Parameters section of the API Step ā https://docs.voiceflow.com
Voiceflow
Welcome to Voiceflow's docs
Build, manage, and deliver chat and voice agents for customer support and beyond.