Send image to API via REST API

New here, first post. I am attempting to send an image to to test sending an image. I can send an image successfully in Postman. I am getting the file from a file dropzone component. I setting the POST header to content-type = multipart/form-data. In the body, The fileDropzone.value[0] is set to "File", but seems to send as string. In ReTool I can see the size, type, base64data values. What am I doing wrong? Thank you.

Hi @rgreen - welcome to the forums. There are a number of posts around here on uploading images via API, and in general the answer starts with "what is the API expecting?" and the answer ends with some sort of management of the fileDropzone.value object (send the name with a different key; transform the Base64 to binary...).

Can you share a screenshot of what the successful Postman setup looks like and a screenshot of what you have setup that isn't working?

1 Like

This is the response to the Postman request:

The Postman settup:

The response from the ReTool request:

The trick is that the content-type is set automatically by Retool when you set the body to Form Data (see this post).

So, you can just do this:

And it gives you this:

Success! thanks!