Form-Data in not working

I’m facing some problem when using postman. When I’ll try to send raw data in JSON(application/json) format, it get success.

but But when I’ll try to send form data it returns some error.

@spacecraft-explorer Welcome to the Community :partying_face:

Developer would have designed few things, and the API will work that way. Only if your API supports form data you can send the data through it. So if the raw format is working fine, may I know the purpose of using the form data here? Also generally for form data, even the content-type will be like “multipart/form-data” (sample value) , again it should be mentioned clearly in the API documentation.

If your API supports form data for POST request, please check the header values and try again :blush:

i want to upload picture with this data… So I use form-data. but getting validation failed error

Thank for welcoming me…!!!

1 Like

@spacecraft-explorer Yes bad request is something wrong with the data sent as part of your body. Means the API is not able to handle it when you do it via form data. Also is it mentioned somewhere that your API is capable of handling the images as part of the body?

Hi @spacecraft-explorer

Can you please try to check raw data in console and see if there are any differences using raw and form data?