title: Getting 400 Bad request when building JSON Object to send with POST
body: <p>I am trying to build a JSON to send with a POST, but it seems that I am doing something wrong:</p>
  
  <pre><code>var encodedRdf = base64_encode(rdf);
  var data = '{"path": path, "rdf": encodedRdf}';
  </code></pre>
  
  <p>This way I get 400 Bad Request error and it does't fire the REST at all. </p>
  
  <p>Instead if I put hard coded strings as follows it works fine:</p>
  
  <pre><code>var encodedRdf = base64_encode(rdf);
  var data = '{"path": "ppp", "rdf": "rrr"}';
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks,</p>