Creating an api request with Form Data does have the correct body

I have created an api call that will send form data but the body when sending the PUT request does not look as I would have expected it, resulting in a 400 response from our API. Value from text box example would be #FFFFFF

Here is an example of the postman body

Is this an issue or something I have configured incorrectly

@benretool looks like the API Request is a PUT and NOT a POST in what you set up in Retool

yeah sorry I meant a PUT request

this is tough to debug as I can't see the field value or the form. Should the BODY of the PUT request be JSON instead?

no its a multipart form

Hi @benretool!

Form data is a little tricky to debug since we won't be able to see what's actually being sent to your API in the request. I'm noticing that you have a Bearer OAUTH2_TOKEN Authorization header in the query itself though, this is usually included in the resource setup page. Have you been able to make other successful requests to this resource?

@Kabirdas in terms of postman yes I can successfully send the request and get the response I expect. The RETOOL call is passing Auth and hitting validation for the request being null. I was able to get the endpoint to work through retool by changing the body from From Data to x-www-form-urlencoded. Whilst this is fine its not exactly what im looking for as I actually have other files I want to send in the same call that wont work with that body type.

Below you will see the api call and im also using the transformer as per documentation for the bug that exists with the upload component


This leads me to think there's something wrong with the API call but I believe my configuration in retool is correct

Hmm... are you getting any additional error messaging from your API?