title: HTTP REQUEST in curl
body: <p>how can I make an HTTP REQUEST in curl with json?</p>
  
  <p>I need to put this in curl for php:</p>
  
  <pre><code>POST /api/ra/v1/ping HTTP/1.0
  Host: app.kigo.net
  Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
  Content-Type: application/json
  {
  "PING" : "PONG"
  }
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is what I've tried, but it shows "Invalid Content-Type header.":</p>
  
  <pre><code>&lt;?php
  $url = 'https://app.kigo.net/api/ra/v1/ping';
  $headers = array( 'Authorization' =&gt; 'Basic dXNlcm5hbWU6cGFzc3dvcmQ=', 'Content-Type' =&gt; 'application/json' );
  $ch = curl_init();
  curl_setopt($ch,CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch,CURLOPT_POSTFIELDS, "PING=PONG");
  $result = curl_exec($ch);
  curl_close($ch);
  print_r( $result );
  ?&gt;
  </code></pre>