curl_setopt($curl_handle, CURLOPT_URL, 'url');
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_handle, CURLOPT_PORT, 1010);
curl_setopt($curl_handle, CURLOPT_HEADER, array(
"Content-Type: application/json",
"Access-Control-Allow-Origin:*"
));
For headers i think its CURLOPT_HTTPHEADER
$ch = curl_init(); $url = $_GET["url"]; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); //Execute request $response = curl_exec($ch); //get the default response headers header('Content-Type: application/json'); header("Access-Control-Allow-Origin: *"); //close connection curl_close($ch);
Обсуждают сегодня