我试图在我的控制器上检索一些信息 使用GuzzleHttp
use \GuzzleHttp\Client;
class ClientsController extends Controller
{
public function index()
{
$client = new Client(['base_uri' => 'http://localhost/systeml/public/ws/clients']);
$response = $client->request('GET', '');
$contents = $response->getBody()->getContents();
dd($contents);
}
运行此命令时出现以下问题
(1/1)ServerException服务器错误:
GET http://localhost/systeml/public/ws/clients
导致500 Internal Server Error
回复:
guzzle运行正常并且在尝试访问其他本地服务器时遇到问题?