Laravel 6 on Homestead:http发布请求“连接被拒绝”

时间:2020-09-28 13:11:34

标签: http-post guzzle laravel-6

我正在尝试将某个类的发帖请求发送到/ oauth / token,但是连接被拒绝

class OAuth2ProxyClient implements ProxyInterface
{
const OAUTH_TOKEN = '/oauth/token';

在函数内部:

$http = new \GuzzleHttp\Client();
return $http->post(config('app.url').self::OAUTH_TOKEN, $this->getBody());

但是我总是得到:

cURL error 7: Failed to connect to app.test port 8000: Connection refused

我也尝试过

return $this->post(self::OAUTH_TOKEN, $this->getBody());

.env

APP_URL=http://app.test:8000

如何解决此问题以在此处向/ oauth / token发送发帖请求?

0 个答案:

没有答案