{"id":13700025,"url":"https://github.com/fastdlabs/http","last_synced_at":"2026-01-29T14:33:52.049Z","repository":{"id":34944382,"uuid":"39018123","full_name":"fastdlabs/http","owner":"fastdlabs","description":"Support Swoole Implement PSR7","archived":false,"fork":false,"pushed_at":"2026-01-04T13:22:41.000Z","size":718,"stargazers_count":28,"open_issues_count":3,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-04T16:22:51.854Z","etag":null,"topics":["fastd-http","http","psr7","support-swoole","swoole","swoole-http"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastdlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-07-13T14:46:52.000Z","updated_at":"2024-12-16T07:19:07.000Z","dependencies_parsed_at":"2022-09-15T22:30:40.108Z","dependency_job_id":"0f6ed783-5798-4aa2-ad40-8beacb985594","html_url":"https://github.com/fastdlabs/http","commit_stats":{"total_commits":340,"total_committers":11,"mean_commits":30.90909090909091,"dds":0.4970588235294118,"last_synced_commit":"4f0b3e55384bc2d73b749bc07e8c3a7e58625a05"},"previous_names":["janhuang/http"],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/fastdlabs/http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastdlabs%2Fhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastdlabs%2Fhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastdlabs%2Fhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastdlabs%2Fhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastdlabs","download_url":"https://codeload.github.com/fastdlabs/http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastdlabs%2Fhttp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28879662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastd-http","http","psr7","support-swoole","swoole","swoole-http"],"created_at":"2024-08-02T20:00:47.439Z","updated_at":"2026-01-29T14:33:52.028Z","avatar_url":"https://github.com/fastdlabs.png","language":"PHP","readme":"# FastD HTTP Server and Client \n\n[![Build Status](https://travis-ci.org/fastdlabs/http.svg?branch=master)](https://travis-ci.org/fastdlabs/http)\n![Support Swoole](https://img.shields.io/badge/support-swoole-brightgreen.svg)\n![Support PSR7](https://img.shields.io/badge/support-psr7-brightgreen.svg)\n[![Latest Stable Version](https://poser.pugx.org/fastd/http/v/stable)](https://packagist.org/packages/fastd/http) \n[![Total Downloads](https://poser.pugx.org/fastd/http/downloads)](https://packagist.org/packages/fastd/http) \n[![Latest Unstable Version](https://poser.pugx.org/fastd/http/v/unstable)](https://packagist.org/packages/fastd/http) \n[![License](https://poser.pugx.org/fastd/http/license)](https://packagist.org/packages/fastd/http)\n\n简单的 Http 协议组件, 用于解析 Http 请求信息, 实现 PSR-7 标准, **支持 Swoole 扩展**.\n\n以上库可以满足大部分 HTTP 请求处理相关工作, 支持 Swoole 处理, 具体请看项目[Swoole](https://github.com/JanHuang/swoole)。\n\n## 要求\n\n* php \u003e= 5.6\n\n## 安装\n\n```\ncomposer require \"fastd/http\" -vvv\n```\n\n## 文档\n\n[文档](docs/readme.md)\n\n## 使用\n\nHTTP 组件封装了常用的服务端解释,客户端请求,并且友好集成 Swoole Http Server 解析，实现PSR-7。\n\nHTTP 组件没有对 Session 进行封装, 如果想在项目中支持 Session, 可以通过 [Session](https://github.com/JanHuang/session) 组件进行扩展. \n\n##### 获取 pathinfo\n\n```php\nuse FastD\\Http\\ServerRequest;\n\n$request = ServerRequest::createServerRequestFromGlobals();\n\n$request-\u003egetUri()-\u003egetPath();\n```\n\n##### Swoole Http 服务器\n\n```php\n$http = new swoole_http_server(\"127.0.0.1\", 9501);\n\n$http-\u003eon('request', function ($request, $response) {\n    $server = SwooleServerRequest::createServerRequestFromSwoole($request);\n    $response-\u003eend($server-\u003egetUri()-\u003egetPath());\n});\n\n$http-\u003estart();\n```\n\n##### cURL 请求\n\nRequest 对象内部封装了 cURL 请求, 可以直接通过方法调用\n\n```php\n$request = new Request('GET', 'https://api.github.com/');\n\n$request-\u003esetReferrer('http://example.com/');\n\n$response = $request-\u003esend(); // FastD\\Http\\Response\n```\n\n响应内容会通过 `Response` 对象返回。\n\n### 贡献\n\n非常欢迎感兴趣，愿意参与其中，共同打造更好PHP生态，Swoole生态的开发者。\n\n如果你乐于此，却又不知如何开始，可以试试下面这些事情：\n\n* 在你的系统中使用，将遇到的问题 [反馈](https://github.com/JanHuang/fastD/issues)。\n* 有更好的建议？欢迎联系 [bboyjanhuang@gmail.com](mailto:bboyjanhuang@gmail.com) 或 [新浪微博:编码侠](http://weibo.com/ecbboyjan)。\n\n### 联系\n\n如果你在使用中遇到问题，请联系: [bboyjanhuang@gmail.com](mailto:bboyjanhuang@gmail.com). 微博: [编码侠](http://weibo.com/ecbboyjan)\n\n## License MIT\n","funding_links":[],"categories":["HTTP and WebSocket"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastdlabs%2Fhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastdlabs%2Fhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastdlabs%2Fhttp/lists"}