title: jQuery Ajax POST failed with error 400 (Bad Request)
body: <p>I like to send changed data by using jQuery to a (Java) Rest service. The service isn't in the same domain.</p>
  
  <p>Okay that's the java code for the REST service:</p>
  
  <pre><code>@POST
  @Path(value = "/save")
  @Consumes(MediaType.APPLICATION_JSON)
  public void persistEntities(final Object dto)   { // do something here }
  </code></pre>
  
  <p>This is the jQuery code for the POST request:</p>
  
  <pre><code>    $.ajax({
          url: 'http://csepcchb/zedas/rest/json/save',
          type: 'POST',
          dataType: 'jsonp',
          crossDomain: true,
          data: JSON.stringify(inputData),
          contentType: "application/json; charset=utf-8",
          success:  ... ,
          error:  ... 
      });
  </code></pre>
  
  <p>The request failed error "400 (Bad Request)" (JavaScript Error)</p>
  
  <p>The serverlog says</p>
  
  <pre><code>Failed to parse request.: java.lang.IllegalArgumentException: Illegal character in query at index 90: http://csepcchb/zedas/rest/json/save?callback=jQuery21103997392114251852_1402577652794&amp;%22{\%22bezeichnung\%22:\%22*42017\%22,\%22elementArt\%22:\%22Aufr%C3%BCsten\%22,\%22beginn\%22:\%2213:15\%22,\%22start\%22:\%22BRBD\%22,\%22ziel\%22:\%22BRBD\%22,\%22ende\%22:\%2201:02\%22,\%22beschreibung\%22:null}%22&amp;_=1402577652796
  </code></pre>
  
  <p>If I tried also this, without success</p>
  
  <pre><code>data: inputData
  </code></pre>
  
  <p>Who can help me please to resolve the problem?</p>