PHP的HTTP客户端:Httpful

WBOY
Release: 2016-06-20 12:52:38
Original
1843 people have browsed it

Httpful 是一个链式,REST友好的 PHP Http 客户端, cURL的一个健全替代。它的优点在强调可读性,简洁性、和灵活性,并提供基本的功能和灵活性帮助开发者完成工作,让功能易于实现。

特性:

  • 可读的 HTTP方法支持(GET, PUT, POST, DELETE, HEAD, PATCH 和 OPTIONS)

  • 可定制化的头文件

  • 自动“智能”解析

  • 自动负载系列化

  • 基本认证

  • 客户端证书验证

  • 请求“模板”

示例代码:

$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";}
Copy after login

项目主页:http://www.open-open.com/lib/view/home/1437227778693

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template