我是 amphp 的新手,我想先试试这个非常简单的代码。我下载了带有 composer for windows 的 amphp 并保存了在我的项目文件夹中创建的所有文件夹。
composer require amphp/http-client
然后我的代码是:
<?php
require __DIR__ . './autoload.php';
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\HttpException;
use Amp\Http\Client\Request;
use Amp\Http\Client\Response;
use Amp\Loop;
$stringa = 'http://www.google.it/';
$request = new Request($stringa, "GET");
$location = $request->getHeader("Location");
var_dump($location);
但我总是得到'致命错误:未捕获的错误:找不到类'Amp\Http\Client\Request''
有什么建议吗?
我使用带有 php 7.0 的 wamp 本地服务器
另外,之后,我需要yield
所有的代码......