phpcurl/curlhttp
Composer 安装命令:
composer require --dev phpcurl/curlhttp
包简介
Super simple HTTP client
关键字:
README 文档
README
The simplest cURL HTTP client for PHP
Install
Via composer:
$ composer require "phpcurl/curlhttp"
Usage
<?php use PHPCurl\CurlHttp\HttpClient; $http = new HttpClient(); $response = $http->post('http://example.com/?a=b', 'my post data', ['User-Agent: My php crawler']); // Supported: get(), post(), head(), post(), put(), delete() $body = $response->getBody(); // Response body, string /* <!doctype html> <html> ... </html> */ $statusCode = $response->getStatus(); // HTTP status, int /* 200 */ $headers = $response->getHeaders(); // HTTP response headers, array /* array( 0 => 'HTTP/1.1 200 OK', 1 => 'Accept-Ranges: bytes', 2 => 'Cache-Control: max-age=604800', 3 => 'Content-Type: text/html', 4 => 'Date: Wed, 03 Feb 2016 07:01:58 GMT', 5 => 'Etag: "359670651"', 6 => 'Expires: Wed, 10 Feb 2016 07:01:58 GMT', 7 => 'Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT', 8 => 'Server: ECS (rhv/818F)', 9 => 'Vary: Accept-Encoding', 10 => 'X-Cache: HIT', 11 => 'x-ec-custom-error: 1', 12 => 'Content-Length: 1270', ); */
phpcurl/curlhttp 适用场景与选型建议
phpcurl/curlhttp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 978 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 02 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「dependency」 「curl」 「testing」 「phpunit」 「mock」 「injection」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 phpcurl/curlhttp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phpcurl/curlhttp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 phpcurl/curlhttp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
cURL and cURL based Soap-Client for PHP
Simple cURL wrapper
Testing Suite For Lumen like Laravel does.
A fast and intuitive dependency injection container.
The PHP SDK for Checkmango
A fluent PHP CURL wrapper
统计信息
- 总下载量: 978
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-03