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
2
votes
1 answer

POST request returns 415 - Unsupported Media Type

Even if this error is known, I was not able to solve my issue! The reset Service is declared in this code : @POST @Transactional @Consumes(MediaType.APPLICATION_JSON) @Path("/addProduct") public void…
Mohamed Taboubi
  • 6,663
  • 11
  • 55
  • 87
2
votes
1 answer

415 when passing string parameter to Web Api Post method

When I POST this request to http://localhost:61679/api/Login: Headers => Content-Type: text/plain Body => grant_type=password&username=doug&password=12345 I get 415 Unsupported Media Type: HTTP/1.1 415 Unsupported Media Type Cache-Control:…
2
votes
1 answer

Spring MVC : JSON to Pojo conversion throwing HTTP 415 Error

I am constructing the following JSON in my jQuery and sending to controller via ajax var jsonResponse = []; $(columns).each(function() { if(!isEmpty($(this))) { var lang = $(this).find(".language").val(); var item = { …
AgentX
  • 1,402
  • 3
  • 23
  • 38
2
votes
1 answer

Why is status code 415 returned when an uploaded file is missing in a JAX-RS request body?

I am creating a mobile API that accepts some params in headers and a file(optional) in body as multi part. Now when I try to submit with file present, it works just fine, but when the file is not present in the request it says 415 error. below is…
Jayesh
  • 402
  • 1
  • 4
  • 22
2
votes
1 answer

415 error when uploading to API

I am trying to write an automatic subtitle finder in Python 3.x using The SubDB (http://thesubdb.com/api/). I'm now working on an upload feature. However, I cannot get it to work. I keep getting a 415 error (Unsupported Media Type). On the SubDB…
Roberto
  • 958
  • 13
  • 33
2
votes
1 answer

Retrofit image upload returns 415 Unsupported Media Type

I have a REST Resource using JBoss & RestEasy as follows @Path(ServiceURL.MEDIA) public class ImageUploadService { @POST @Consumes({APPLICATION_OCTET_STREAM}) public Response upload(@QueryParam("contenttype") String contentType,…
Jonathan Viccary
  • 722
  • 1
  • 9
  • 27
2
votes
1 answer

AngularJS + Domain/URL Redirect not working well together

I got a small angularJS based website. I am hosting it via the service OpenShift on some domain like: bla-blubb.rhcloud.com Which is of course not that pretty, so I ordered a TLD: www.supercoolsite.com from www.united-domains.de. There I habe…
BAERUS
  • 4,009
  • 3
  • 24
  • 39
2
votes
1 answer

Play Framework: Returning 400 instead of 415

I am creating a RESTful service using Play. I want Play to reject any request where the media type is not specified as JSON in the request header. There tutorial has a good example of…
Marc M.
  • 3,631
  • 4
  • 32
  • 53
2
votes
2 answers

Spring MVC 3.1 REST services post method return 415

I'm doing a Spring MVC controller and I still get problem with POST operation. I've read many solutions on stackoverflow without to fix my problem. My achievement at the moment : I sent a GET request with an Id and return an Object converted to…
user1842947
  • 1,047
  • 1
  • 11
  • 16
2
votes
4 answers

Android app to read JSON from website

I'm trying to start off my Android app journey with an app to display information from a website. The website is from a power draft system that helps me monitor temperatures of the fire and pieces of meat that I'm cooking for long periods of time…
2
votes
1 answer

Unable to post the data to server, getting error java.io.IOException: Server returned HTTP response code: 415

Iam unable to post the data to the server, getting error as . But it is working fine in curl script. Error reading URL java.io.IOException: Server returned HTTP response code: 415 for URL:…
developer
  • 9,116
  • 29
  • 91
  • 150
1
vote
2 answers

Spring Boot Unsupported Media Type 415 Content type '' not supported for request with empty parameters

I have following rest controller RestController.class: @AllArgsConstructor @RestController @RequestMapping(value = "/foo", produces = APPLICATION_JSON_VALUE) @Api(value = "restController ") class RestController { private final Service service; …
1
vote
2 answers

sending http request to my server is incorrect

Frontend todo.ts and todo.html Console.log Postman backend-code with spring boot //TodoService; function for Update public Todos updateTodoWithMap(Long id, Map objectMap) { Optional todos =…
ddola
  • 21
  • 2
1
vote
1 answer

Minimal API - 415 error when using multipart/form content type and custom body model

First of all, here is a POST mapping that DOES work : app.MapPost("formulary/uploadSingle/{oldSys}/{newSys}", async (HttpRequest request, string oldSys, string newSys) => { return await…
Martin
  • 1,977
  • 5
  • 30
  • 67
1
vote
1 answer

React Fetch Method return 415

I'm trying post request by my react app and I have return status 415. I tested this endpoint by postman exactly which I got from this console.log(JSON.stringify(data.data)); and all is right. I notice that my request haven't the same content-type…
xaos
  • 21
  • 1
1 2
3
10 11