[英]How to send a GET request with cookies and do not wait for response using PHP
[英]How to send the next cookies in get request?
我收到503錯誤,但是如果我從inspect元素發送它,那很好。
該代碼之前對我有用,但是在過去的幾個小時中,特定網站添加了cf_clearance,我也需要將其添加到請求中
如何發送兩個Cookie?
$opts = array(
'http'=>array(
'method'=>"GET",
'proxy'=>"",
'header'=> "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0\r\n" .
"Cookie: cf_clearance=3de18fcd39d55ce82d9db-1529352303-31536000; PHPSESSID=oahfun4m7vi3edd71\r\n"
));
$context = stream_context_create($opts);
$url = "http://website.com";
$data = file_get_contents($url, false, $context);
echo $data;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.