I am calling a REST service with a JSON request and it responds with a HTTP 415 "Unsupported Media Type" error. The request content type is set to ("Content-Type", "application/json; charset=utf8").
¿Cómo resolver el error Http 415 (Unsupported Media Type)? Formular una pregunta Formulada hace 1 año y 11 meses Modificada hace 1 año y 11 meses
I try to call my API in a method but i get the error: {StatusCode: 415, ReasonPhrase: 'Unsupported Media Type'. I have been looking around and found a lot of people have had the same problem but it have been solved by adding the media type when creating the StringContent.
415 Unsupported Media Type The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method. This can happen with an invalid Content-Type HTTP header. The correct MIME media type for JSON is application/json.
415 is the client is sending a content-type in the request header and so server straightforwardly rejects saying unsupported media type to overcome 406 - we must include the appropriate dependent jars say a client wants an XML input to be understood by the server, then the server needs to have XML related dependencies.
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.
415 Unsupported Media Type - POST json to OData service in lightswitch 2012 Asked 12 years, 6 months ago Modified 1 year, 8 months ago Viewed 246k times