Error parsing JSON body of POST in HTTP -Make an API Key Auth Request

I would like to use the result in Gemini AI to generate an image with FLUX by calling together.ai api.
In HTTP, the input section, it can get the ‘Result’ generated from previous connector “Gemini AI” . The ‘result’ does not have any special charcters.
And i ever tried to set a variable to store the ‘Result’ and inputting this in the request content, also output error parsing JSON body of POST.
When i don’t use the variable from previous connector but a plain text, it works fine.
Please help.

FLOW

INPUT SECTION In HTTP


OUTPUT SECTION In HTTP

HTTP config

1 Like

Hi JC,

I think I can see an issue in the API Call where the Prompt is being sent.

Notice the line break at the end of the prompt? Try adding some IML functions like the screenshot below and replace the ‘var’ with your prompt. The newline is likely causing a parsing issue - alternatively if you wanted to be sure, you can paste JSON into a text editor like VS Code, and it may highlight where issues with the JSON are.


Hope this helps!

Best regards,
Jacob

1 Like

Thank you very much. It works now.

2 Likes

Hi JC,

No worries at all, glad to hear it works! :smiling_face:

If you are able to please mark this as a solution so others with similar issues in the future are able to refer back to this.

Best regards,
Jacob

1 Like

Welcome to the Make community!

If you have a more complex input string, you can also use the Transform to JSON module.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.