Questions tagged [http-status-code-415]

HTTP status code for Unsupported Media Type

This is usually because of typos in Content-Type header. Or in the rare case, where you're really sending unsupported media.

MDN Documentation

155 questions
212
votes
25 answers

Http 415 Unsupported Media type error with JSON

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"). It works fine if I don't include a JSON object in…
user3443794
  • 3,411
  • 3
  • 13
  • 9
196
votes
15 answers

POST JSON fails with 415 Unsupported media type, Spring 3 mvc

I am trying to send a POST request to a servlet. Request is sent via jQuery in this way: var productCategory = new Object(); productCategory.idProductCategory = 1; productCategory.description = "Descrizione2"; newCategory(productCategory); where…
gc5
  • 9,468
  • 24
  • 90
  • 151
66
votes
7 answers

HTTP 415 unsupported media type error when calling Web API 2 endpoint

I have an existing Web API 2 service and need to modify one of the methods to take a custom object as another parameter, currently the method has one parameter which is a simple string coming from the URL. After adding the custom object as a…
AK3800
  • 2,138
  • 3
  • 23
  • 28
18
votes
3 answers

WebApi 2.1 PUT throw error 415

I'm trying to update data using WebApi PUT method. My code working fine before, but suddenly I start to get this error. "Message":"The request contains an entity body but no Content-Type header. The inferred media type 'application/octet-stream' is…
andrey.shedko
  • 3,128
  • 10
  • 61
  • 121
16
votes
3 answers

Python request gives 415 error while post data

I am getting 415 error while posting data to server. This is my code how can i solve this problem. Thanks in advance! import requests import json from requests.auth import HTTPBasicAuth #headers =…
Mitra Mishra
  • 161
  • 1
  • 1
  • 4
11
votes
3 answers

HTTP Status 415 - Unsupported Media Type

I am working on Java restful web service. While testing the restful service I am getting the responses correct for GET and DELETE methods but it is not working for POST and PUT methods. Can anyone help me? I have written the following…
Manohar Bomma
  • 311
  • 1
  • 3
  • 17
6
votes
3 answers

How to fix 'HTTP-415' error, during POST request in REST web service using spring boot

I am a beginner in Spring Boot and learning my way through. How to fix 'HTTP-415' error, during POST request in REST web service using Spring Boot as below? I have tried @RequestMapping annotation, @RequestParam. @RequestParam gives some other error…
5
votes
2 answers

415 (Unsupported Media Type) in $http.post method

I'm quite new to REST and AngularJS, but after several hours of googling I couldn't find any answer to my question: I'm trying to do a POST request from my angularjs frontend to my backend implemented in java (using JPA). When I'm trying to create a…
nicost
  • 1,022
  • 2
  • 11
  • 27
5
votes
2 answers

HTTP Status 415 - Unsupported Media Type for AJAX call in JQUERY to Restful WS implemented with JERSEY

Hi I am trying to post json data to Restful WS implemented with Jersey. I am posting data through jquery-ajax. Why am I geting HTTP Status-415 unsupported Media type? Thank you. Click here for screenshot of firebug description //post method handler…
Mike
  • 725
  • 2
  • 11
  • 21
4
votes
2 answers

C# HttpClient returns 415 Unsupported media type on Patch request

We have a .netcore 3.1 ApiController with an endpoint listening for PATCH requests, and defined a Test Server that we're using for the Integration/API tests. PATCH request sent with Postman works just fine, but requests sent via HttpClient inside…
4
votes
1 answer

Only if run through Eclipse: POST on Spring Boot Controller fails with HTTP Error 415

The problem: We have a working Spring Boot backend server (Java 11, Spring Boot 2.2.4.RELEASE) with a React frontend, which runs perfectly in a Docker container, if run through java -jar app.jar and if run through IntelliJ. If it is run through…
mfbieber
  • 143
  • 7
4
votes
3 answers

API Gateway + Lambda - CORS Issue

i am experiencing continuing problems with the CORS integration for API Gateway + Lambda. i have enabled CORs for the resources associated with the API. Everything appears to work fine via Lambda testing, Postman testing etc, but calling the api…
Patrick
  • 41
  • 1
  • 2
4
votes
0 answers

How to indicate supported media types after a HTTP 415 Unsupported Media Type

For example an endpoint gets a POST request with content type application/vtortola+json;version=2, however such endpoint just supports version=1, so an HTTP 415 Unsupported Media Type is returned. I wonder if there is any specific HTTP mechanism to…
vtortola
  • 34,709
  • 29
  • 161
  • 263
4
votes
1 answer

Spring MVC, jQuery with ajax - getting 415

I am using Jquery to send an AJAX POST request. On success I need to redirect the user to a different page, on failure I want to stay on the page with the same data. I am having 2 issues. On SUCCESS, it is not redirecting, it stays on same URL &…
AgentX
  • 1,402
  • 3
  • 23
  • 38
4
votes
1 answer

Unsupported Media Type - HTTP Status 415

I have a problem with my web service. GET requests are executed well and correct but the post request is getting the HTTP Status 415. The project I am working on is a JAX-RS RESTful API that will need to communicate with an Android mobile…
1
2 3
10 11