❔ Sending IFormFile in Postman
endpoint parameter is OfferCreateDto and I can't send it in Postman, when I sending one image as form-data in other endpoint it works, can someone tell me what's wrong here?
7 Replies
I don't think you can send images with JSON
You need
x-form-urlencoded
payload, or whatever it's called
Ah, wait, you are sending formdata, huh
Does the API endpoint get the data from form, though?
[FromForm]
on the parameter?nah dto is only parameter, im trying to avoid split it to 2 parameters (IFormFile list and dto)
Well, there's you answer
ASP thinks
offerDto
should be parsed from JSON
But it's a formso split it is only way?
You can't send some of the request as JSON and some of it as form data
Send everything as form data
so I didn't have to modify endpoint input in code?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.