为什么在此curl请求中未设置cookie?

时间:2019-05-16 05:18:48

标签: php curl

我正在尝试在curl请求上设置一个cookie,但是它没有被设置,我也不明白为什么。

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://amindi.ge/days-forecast");

$headers = array(
'Cookie: city=%E1%83%9B%E1%83%90%E1%83%9C%E1%83%92%E1%83%9A%E1%83%98%E1%83%A1%E1%83%98',
  );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$response = curl_exec($ch);
curl_close($ch);

0 个答案:

没有答案