下面是我的PHP代码:
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/contacts/contact_id');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Bearer {access_token}',
'Content-Type' => 'application/json',
'Accept' => 'application/json'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
出现错误:
未捕获的错误:找不到类'HttpRequest'
我从中得到了解决方案。我尝试过:
extension = php_http.dll
但是错误仍然存在。我怎样才能解决这个问题? 我的php版本是: 7.1.8