title: PUT request returning a 400 Bad Request Error
body: <p>I am doing a PUT request to RESTfull service which changes password of a user. For the time being I have just hardcoded values of new and old password in my AJAX test my service. However it is giving me a 400 error.</p>
  
  <p><strong>AJAX call</strong></p>
  
  <pre><code>$.ajax({
          type: "PUT",
          url: "api/teachers/"+user,
         data: {"old":"123","new":"qwe"},
         contentType: "application/json",
          success: function(data,status) 
          {
              datax = data;
              alert(data+status);
              ko.applyBindings(new AddMarkSheetKo(data));           
         },
          error: function(XMLHttpRequest, textStatus, errorThrown)
          {
              alert(XMLHttpRequest+textStatus+ errorThrown);
                    // error handler here
          }
        }); 
  </code></pre>
  
  <p><strong>Restful function:</strong></p>
  
  <pre><code>    @PUT
      @Path("/{name}")
      @Consumes(MediaType.APPLICATION_JSON)
      public Response changePwd(@PathParam ("name")String name,@QueryParam ("old") String old, @QueryParam("new") String nw){
          System.out.println("entered function"+old+nw);
          Teacher t = DataAccessUtil.getByName(Teacher.class, name);
          if(t.getPassword().equals(old)){
              t.setPassword(nw);
              DataAccessUtil.update(t);
              return Response.ok().build();
          }
          else{
              return Response.status(Status.BAD_REQUEST).entity("Wrong password !!!").build();
  
          }
          //return reposnse;
      }
  </code></pre>
  
  <p>This information might be useful that on the console it prints</p>
  
  <blockquote>
    <p>entered functionnullnull</p>
  </blockquote>
  
  <p>So it the restfull function is called however it is not receiving the query parameters. </p>
  
  <p>Any help would be really appreciated!</p>