title: Curl Response is Empty after posting data via post php
body: <p>I have a form where user puts his apiKey then that after checking for errors if everything is good the processing script post the key via curl to my server for verification. then my server should return success true | false and error code if false. but when I send the file the curl response is empty.</p>
  
  <pre><code>$post['apiKey'] = $apiKey;    
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_URL,"https://www.pawnhost.com/phevapi/verify_api.php");
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  
  $res = curl_exec($ch);
  if ($res === FALSE) {
      echo "Curl Error:" . curl_error($ch);
  }
  
  curl_close($ch);
  
  print_r($res);
  </code></pre>
  
  <p>Script we are submitting to:</p>
  
  <pre><code>&lt;?php 
  
  define("ERROR_HEADER_URL", "Location: " . $_SERVER['HTTP_REFERER'] . "?error=");
  
  require("includes/initialize.php");
  
  if ($_SERVER['REQUEST_METHOD'] != 'POST') header(ERROR_HEADER_URL . "invalidRequest");
  
  if (!isset($_POST['apiKey'])) header(ERROR_HEADER_URL . "verficationFailed");
  
  $apiKey = escape($_POST['apiKey']);
  
  if (isInputEmpty($apiKey)) {
      header(ERROR_HEADER_URL . "emptyFields");
  
  } elseif (!$apiKey == 25) {
      header(ERROR_HEADER_URL . urlencode("invalidKey"));
  
  } else {
  
      $response = [];
  
      if (getApiKeyUserDetails($apiKey, $connection)) {
  
          if (getApiKeyUserDetails($apiKey, $connection)['apiKeyUsed'] &gt; 0) {
              $response['success'] = false;
              $response['error'] = 'apiKeyUsed';
          } else {
              makeApiKeyUsed($apiKey, $connection);
              $response['success'] = true;
          }
  
      } else {
          $response['success'] = false;
          $response['error'] = 'invalidApiKey';
      }
  
      return json_encode($response);
  
  }
  </code></pre>