0

I'm using Jersey to expose a REST API.

I get HTTP error 415 : Unsupported Media Type when I try to send a request to the following entry point :

  @POST
  @Path("check")
  @Produces("application/json")
  Response checkPassword(char[] password);

But when I turn my password into String, It works fine :

  Response checkPassword(String password);

The idea of using a char[] is to apply some good practices as stated here : Why is char[] preferred over String for passwords?

Does anyone knows why I get 415 with char [] ?

Regards

Community
  • 1
  • 1
Doe
  • 1

1 Answers1

0

Can you please post your POST request?

As the message tells it is the mediatype of the request which is not supported.

@Consumes("application/json")

which type of data you expect. This could be json (then you normally wrap this into some object, or text/plain or xml or whatever you like but currently the type jersey expects is not matching the transfered type either on request or response.