I am doing an HTTP POST using cURL
$url = "http://localhost:8080/~demo/cgi-bin/execute/100";
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($data));
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
//execute post
$result = curl_exec($ch);
echo("$result");
//close connection
curl_close($ch);
The post gets executed, but the response is shown with the error:
The requested URL /~demo/100 was not found on this server.
The above URL, obviously, does not exist not the server because (somehow) cURL has changed the URL.
It should have been /~demo/cgi-bin/execute/100
. This URL works in browser.
Please tell me why does it do that? AND how can i stop this, for what I want?