title: REST request fails with URI encoded path parameter
body: <p>I use <strong>AngularJS</strong> (client) and a <strong>REST interface</strong> in my project (server, <code>javax.ws.rs.*</code>). I'm passing data in a path parameter. It may contain <em>special characters</em>, so I call <code>encodeURIComponent()</code> to encode the arguments prior to sending a request.</p>
  
  <p><strong>Client-side:</strong></p>
  
  <pre><code>$http.put('/foo/data/' + encodeURIComponent(data) + '/bar');
  </code></pre>
  
  <p>The controller will process the request and send a response.</p>
  
  <p><strong>Server-side:</strong></p>
  
  <pre><code>@PUT
  @Path("/data/{data}/bar")
  public ResultObject handleFooRequest(@PathParam("data") String data) throws Exception {
    return handleRequest(data);
  }
  </code></pre>
  
  <p>This works fine on <code>localhost</code>, however, the request fails when I do a request on our production server (<em>Error 400: Bad request</em>). What am I doing wrong and why is it working on one server and fails on the other? In general, is my approach correct? Do I need to tell RESTEasy to decode the arguments? To my understanding (I read the documentation), it does that on default.</p>