API keeps saying JSON only, but JSON is being sent

I am currently running into an issue with my code where I have to send JSON to post an API, but when I send JSON it always says it is receiving text.

image

https://x.thunkable.com/projects/6566796a8f7787bd7ba632fc/1a3e5828-0392-4bf0-8256-2977271336b3/blocks

You might need to add a content-type header like in the screenshot here: Cannot set API header for Content-Type

I had a similar issue with another API. The fix was to add ‘Content-Type’ and ‘accept’ headers to the call, with the text of both set to ‘application/json’.

Can you see an example successful call on the API website for example? It’ll show you what the various elements of a successful call are.

What is the link to that?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.