1
I have the following controller:
public IActionResult Post([FromQuery] int Width, [FromQuery] int Height, [FromForm] IFormFile Image)
With Insomnia / Postman, I can do a post command and pass the width / height parameters in the url.
I am trying to do the same with CURL but the second parameter is not seen. In this case, height will be 0
curl -F image=@photo.jpg test/thumbnail?width=320&height=240
In that case, width will be 0
curl -F image=@photo.jpg test/thumbnail?height=240&width=320
What am I missing?
what OS/utility set are you working on? i'd start by reading the man page or equivalent for your implementation/distribution/whatever and check the
--data
or-d
option – ivanivan – 2018-05-09T00:03:36.500I'm on Mac; I tried -d "width=320" -d "height=240" but Curl told me it wasn't compatible with the multi-part post – Thomas – 2018-05-09T00:04:35.817
Try them together -
-d "width=320&height=240"
– ivanivan – 2018-05-09T00:19:48.773