【问题标题】:Laravel Guzzle error when post to url in job queue在作业队列中发布到 url 时 Laravel Guzzle 错误
【发布时间】:2020-03-14 23:57:26
【问题描述】:

在我的工作中,我使用 guzzle 调用 api abc.com/test 有时,当有很多工作在申请时。工作失败 cURL 错误 6:无法解析主机:路由器;未知错误(请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html 所有使用 guzzle 的端点都更改为“路由器”。

$config = [ 
    'verify' => false,
    'timeout' => 30,
    'headers' => ['Content-Type' => 'application/json'],
];
$this->httpClient = new Client($config);
$response = $this->httpClient->request("POST",'abc.com/updateProduct', $data)

【问题讨论】:

  • 您能否展示一些有助于了解您在做什么的代码?
  • $config = [ 'verify' => false, 'timeout' => 30, 'headers' => ['Content-Type' => 'application/json'], ]; $this->httpClient = new Client($config); $response = $this->httpClient->request("POST",'abc.com/updateProduct', $data).

标签: php laravel guzzle6


【解决方案1】:

我们刚刚遇到了同样的问题,降级我们的 NewRelic PHP 代理解决了这个问题,更多信息:https://github.com/newrelic/newrelic-php-agent/issues/255

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2018-04-04
  • 1970-01-01
  • 2021-06-13
  • 2017-05-11
  • 2018-03-28
  • 2022-08-20
  • 2014-12-08
  • 1970-01-01
相关资源
最近更新 更多