10

When I'm trying to consume a Spring MVC method using FF RESTClient, I get the following error:

The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.

This is the method declaration:

@RequestMapping(value = "/login", method = RequestMethod.POST)
public ResponseWrapper login(@RequestParam("email")    @NotNull @Size(min=3, max=50) final String email,
                             @RequestParam("password") @NotNull @Size(min=8, max=50) final String password, 
                             final HttpSession session) {

I entered the correct URL, method POST, and in the "Body" section I wrote:

email=admin&password=87654321

I also added the "Content-Type" header with value of "application/x-www-form-urlencoded" as suggested here: Firefox Add-on RESTclient - How to input POST parameters?

The Java code is correct and I can't change it. I have to fix the problem in Firefox RESTClient.

Any help will be profoundly appreciated!


Edit:

I changed a few things and then changed it back and now in works well, don't know why. Anyway I'd be glad if the moderators could delete this question.

Community
  • 1
  • 1
Alon
  • 10,381
  • 23
  • 88
  • 152
  • 1
    I don't know about this rest client, but did you see this [comment](http://stackoverflow.com/questions/13132794/firefox-add-on-restclient-how-to-input-post-parameters#comment42537750_14230099) and did you try to post from the command-line (using httpie or curl, to be sure there's no issue on the java side) –  Aug 14 '16 at 08:58

0 Answers0