Skip to main content
← Data, API & Backend
Data, API & Backend December 5, 2021 · 11 replies

FormData issue for POST API

Archived from the Bravo community forum (2021–2026). Some answers may refer to older versions of Bravo.

11 replies

Karla December 6, 2021

Insufficient data to help you on this.
What about: your post request and the answer you get and the fields you are using that aren’t working?

SHYAM December 6, 2021

Below is the API I am using for the POST request, It has a few values like name, chain etc for the parameters and file in the body.

And also you can see my setup on Bravo Studio. I have the parameter values in the Query parameters section and File value in the Body FormData Parameter.

But the error I get is "Expected UploadFile but got a <str>"

Screenshot 2021-12-06 at 12.28.40 PM.png

Screenshot 2021-12-06 at 12.28.16 PM.png

Karla December 6, 2021

have you tried to change file image.png to the complete url?

SHYAM December 6, 2021

Hey Karla
The api is not accepting any urls but is accepting only file in a form data

Karla December 6, 2021

I see, I don’t know how you will do this to be honest. You may need a script to handle the file.

app.monster December 6, 2021

I would agree with Karla. I have never worked with a format other than the URL but maybe someone from the Bravo team can validate if the format is even possible at the moment

--form 'file=@/path/to/file_to_upload.png;type=image/png'

SHYAM December 6, 2021

Thanks a lot for the reply Jonas. Hope anyone from the Bravo Team have an answer

Javier Felipe Bravo team December 7, 2021

Hi ! We believe this should be possible if you use the form-data option inside the API request body, as you tried there. But you actually need to use a variable, and then bind it to your form input field, as shown in these screenshots:

image.png

image (1).png

SHYAM December 7, 2021

Thanks a lot. Will definitely try this and reply back here.

Wrote something in this thread and want it removed? Request removal

Still stuck?

Ask the community on Discord

This archive is read-only. New questions, office hours and product updates now happen in the Bravo Discord.

Join the Discord