【问题标题】:Do a request cURL in php, using ip of PROXY LIST - webshare.io?使用 PROXY LIST - webshare.io 的 ip 在 php 中请求 cURL?
【发布时间】:2021-12-23 19:26:40
【问题描述】:

您好,我正在尝试使用代理列表 ip 向网站发出请求,但我不能。我在 php.ini 中的 cURL 请求中不断收到错误消息。 我哪里做错了?

$ request = curl_init ('https://www.webisite-request.com/');
curl_setopt ($ request, CURLOPT_PROXY, '102.xxx.xx.xx');
curl_setopt ($ request, CURLOPT_PROXYUSERPWD, 'user: password');
curl_setopt ($ request, CURLOPT_PORT, 5725);
curl_setopt ($ request, CURLOPT_HTTPHEADER, array (
'Authorization: Token qiwnnqncnqiomcoiemcoq',
"Content-Type: application / json",
"Accept: application / json",
"Accept-Language: it-it",
"Accept-Encoding: gzip, deflate, br",
"Origin: https://www.webisite-request.com/",
));
curl_setopt ($ request, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ request, CURLOPT_HEADER, true);
$response = curl_exec ($ request);
curl_close ($ request);

我正在使用 webshare.io,但我不明白问题出在哪里

【问题讨论】:

  • 可能有助于在问题中包含错误文本/代码。
  • 如何显示?
  • 我认为是 webshare 的问题 :( 也许我必须添加其他的
  • 您可以通过编辑您的问题并粘贴来向我们显示错误
  • @ADyson http状态码为00

标签: php curl web-share


【解决方案1】:

这样设置代理端口:

curl_setopt ($ request, CURLOPT_PROXY, '102.xxx.xx.xx:5725');

不要使用 CURLOPT_PORT

【讨论】:

    猜你喜欢
    • 2012-03-15
    • 1970-01-01
    • 2019-03-07
    • 2014-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多