title: How to call other url using php..?
body: <p><strong>when i hit the following url with the postman app its working fine</strong></p>
  
  <p><a href="http://192.168.1.220/cgi-bin/handle_login.tcl" rel="nofollow noreferrer">http://192.168.1.220/cgi-bin/handle_login.tcl</a></p>
  
  <p><strong>but when tried with curl its giving me following error</strong></p>
  
  <pre><code>    The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
  </code></pre>
  
  <p><strong>Below is my php code</strong></p>
  
  <pre><code>    &lt;?php
     $postData = array(
     'user' =&gt; 'admin',
     'pw' =&gt; 'admin',
     'submit' =&gt; 'Login'
     );
  
    // Setup cURL
    $ch = curl_init('http://192.168.1.220/cgi-bin/handle_login.tcl');
    curl_setopt_array($ch, array(
    CURLOPT_POST =&gt; TRUE,
    CURLOPT_RETURNTRANSFER =&gt; TRUE,
    CURLOPT_HTTPHEADER =&gt; array('Content-Type: application/x-www-form-urlencoded'
   ),
    CURLOPT_POSTFIELDS =&gt; json_encode($postData)
  ));
  
   // Send the request
     $response = curl_exec($ch);
  
   var_dump($response);
  
   // Check for errors
    if($response === FALSE){
    die(curl_error($ch));
    }
  
     // Decode the response
      $responseData = json_decode($response, TRUE);
  
  // Print the date from the response
   echo $responseData['published'];
   ?&gt;
  </code></pre>