05-30-2023 01:37 PM
Hi, I'm trying to build my first HTTP connector recipe and I'm running into an issue when I try to use formulas in the request body of a Post call. The request content type is set to json and everything works fine when the body is set to "text". I can add data pills to dynamically set json content and the Post call succeeds and receives the expected response.
I'd like to use formulas to format some of the data pill content (like .downcase). However, as soon as I switch the Request body window from "text" to "formula", the recipe fails with a 415 error (Unsupported Media Type). At this point, I haven't used any formulas, I've only switched the Request body from "text" to "formula".
In comparing the input json that works (screenshot 1) to the json that fails (screenshot 2), I noticed that the body of json sent as "text" is surrounded by quotation marks, while the body sent as "formula" is not. This doesn't seem to be anything that I can control.
Has anyone come across this before? Thanks.
Solved! Go to Solution.
05-30-2023 05:08 PM - edited 05-30-2023 05:25 PM
Can you send a screenshot of the input/body on the HTTP action? I'd like to see how your formula is written.
Edit: I remember running into this a while ago. I found the simplest way around it was to store the data transformations in a variable before the HTTP, and then insert the variable data pills directly into the text payload. This avoids having to clutter your payload with a lot of inline transformation and ultimately avoids this problem entirely : )
That said, I'm still curious to figure out the root of the issue!
02-03-2026 01:21 AM - edited 02-03-2026 01:22 AM
One solution I would suggest is, instead of using an additional variable (CDM) or directly applying formulas in the HTTP step request body, you can select JSON Request Body in the HTTP step rather than Raw JSON Request Body.
When you choose JSON Request Body as the Request Content Type, you can define the schema based on your request payload. This allows you to easily map data pills from previous steps without writing formulas manually.
For your reference, I am attaching an image. With this approach, there is no need for any additional steps.