WebAPI built-in formatters only support the following media types:
A quick look at what error means:
Quote:The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format.
The format problem might be due to the request's indicated Content-Type or Content-Encoding, or as a result of inspecting the data directly.
Reference: 415 Unsupported Media Type - HTTP | MDN
Now, in your context, you are trying to do:
API method that has to send both json and form-data format to the server
1. You need to make sure the server accepts multiple format as content type payload.
2. Once you are sure of that, then for
, which is what you are sending, look at ASP.NET WebApi: MultipartDataMediaFormatter