I\'m trying to do a multipart form post using the HttpClient in C# and am finding the following code does not work.
Important:
var j
So the problem I'm seeing is that the MultipartFormDataContent
request message will always set the content type of the request to "multipart/form-data". Endcoding json and placing that into the request only "looks" like to the model binder as a string.
Your options are:
Reading through the RFC document and the MSDN documentation you may be able to do this, if you replace MultipartFormDataContent
with MultipartContent
. But I have not tested this yet.