415 Unsupported Media

285 Views Asked by At

415 Unsupported Media what does it mean?

I'm getting this error in my HttpClient MultiPart Form data Request. No matter what change I make in the header or body there is no change in the error. Can anyone shed some light on what I could be doing wrong?

2

There are 2 best solutions below

0
On

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.

So you need to check Content-Type or Content-Encoding these attributes in your header.

0
On

This normally occurs because the Api you are posting to doesn't accept such kind of Media. It could also occur for some Api's if you put one header before the other. Try arranging your headers like this:

Content-Type
Body
Other Api specific headers eg passwords
//Here receive response