Httpful 介绍
Httpful 是一个简单的 PHP 5.3+ 的 Http
客户端。它的优点在高刻度性、简洁性、和灵活性,并提供基本的功能和灵活性帮助开发者完成工作,让功能易于实现。它有以下特征:
示例代码:
$url = "http://search.twitter.com/search.json?q=" . urlencode('#PHP'); $response = Request::get($url) ->withXTrivialHeader('Just as a demo') ->send(); foreach ($response->body->results as $tweet) { echo "@{$tweet->from_user} tweets \"{$tweet->text}\"\n"; }