title: curl command to wp_remote_request command
body: <p>I am trying to translate a curl command into a wp_remote_request command.<br>
  Here is the curl command:  </p>
  
  <pre><code>curl -v 
  -H "Accept:application/json" -H "Content-type:application/json" 
  -X POST -d '{"user":{"password":"***","email":"***"}}'
  http://***/users/sign_in.json
  </code></pre>
  
  <p>And here is my PHP  </p>
  
  <pre><code>$t = array(
       "user" =&gt; array(
                 "password" =&gt; "***", 
                 "email" =&gt; "***"));
  
  $args = array (      
      'headers' =&gt; 
      array (
          'Accept'       =&gt; 'application/json',
          'Content-Type' =&gt; 'application/json',
      ),
      'method'    =&gt; 'POST',
      'body'      =&gt; json_encode( $t )
  );
  
  $response = wp_remote_request( 
             'http://***/users/sign_in.json' , $args );
  </code></pre>
  
  <p>The problem is that it just won't work. I get different errors depending on what i put in the 'body', but usually just a '404'. The only thing i can think of is that the curl -d is somehow encoding the request, but i can't figure out how. Any thoughts? Thanks.  </p>
  
  <p>By the way, the following works fine, but again i would like to use wp_remote_request  </p>
  
  <pre><code>$t = array('user' =&gt; array('password' =&gt; '***',  
                             'email'    =&gt; '***'));
  $curl = curl_init();
  
  curl_setopt_array( $curl, array(
      CURLOPT_RETURNTRANSFER =&gt; 1,
      CURLOPT_URL =&gt; 'http://***/users/sign_in.json',
      CURLOPT_POST =&gt; 1,
      CURLOPT_POSTFIELDS =&gt; json_encode($t),
      CURLOPT_HTTPHEADER =&gt; array('Content-Type: application/json')
  ));
  
  $resp = curl_exec( $curl );
  curl_close( $curl );
  </code></pre>