无法对另一个 Laravel 网站执行 API 调用

Cannot execute API call to another Laravel website

今天我试图用 Guzzle 对另一个服务执行 API 调用。 但问题是,如果我在本地向该服务发出请求,它就可以正常工作。 应该提到的是,当服务在 Modx 时,这样的错误仍然会重现。目前服务已被 Laravel app.

取代

但是当我从开发服务器发出请求时,如果失败并出现以下错误:

`GET http://example.com/api/v1/products?codes=1` resulted in a `415 Unsupported Media Type` response:


production.ERROR: #0 /home/..../vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /home/..../vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/.../vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)

file_get_contents()returns同样的错误。当我在浏览器中打开 link 时,它工作正常

谁能帮帮我?

答案并不简单。 Imunify360 保护已安装在另一端并阻止来自我的服务器的调用。