{"id":37014888,"url":"https://github.com/fishtailstudio/http","last_synced_at":"2026-01-14T01:29:36.258Z","repository":{"id":56982222,"uuid":"282568710","full_name":"fishtailstudio/http","owner":"fishtailstudio","description":"Http GET and POST methods.","archived":false,"fork":false,"pushed_at":"2020-08-21T04:25:19.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-07-30T06:02:28.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/fishtail/http","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fishtailstudio.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}},"created_at":"2020-07-26T03:34:57.000Z","updated_at":"2021-10-11T07:19:19.000Z","dependencies_parsed_at":"2022-08-21T04:40:16.983Z","dependency_job_id":null,"html_url":"https://github.com/fishtailstudio/http","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fishtailstudio/http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishtailstudio%2Fhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishtailstudio%2Fhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishtailstudio%2Fhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishtailstudio%2Fhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fishtailstudio","download_url":"https://codeload.github.com/fishtailstudio/http/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishtailstudio%2Fhttp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-14T01:29:35.724Z","updated_at":"2026-01-14T01:29:36.250Z","avatar_url":"https://github.com/fishtailstudio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n##### 经常在项目里面会用上GET和POST请求方法，使用封装好的方法会方便很多。\n\n## 一、安装\n\n```shell\ncomposer require fishtail/http\n```\n\n## 二、使用\n\n###  1. 导入\n```php\nuse Fishtail\\Http;\n```\n###  2. GET请求\n```php\n$res = Http::get('https://www.baidu.com');\n```\n###  3. POST请求\n```php\n$url = 'http://example.com';\n$header = [\n\t'Accept: */*',\n\t'Content-Type: text/plain;charset=UTF-8'\n];\n$cookie = 'token=2f2568ae-75f0-4ba9-98d4-8c139dad7f64';\n$postData = [\n\t'page' =\u003e 1,\n\t'pageSize' =\u003e 20\n];\n$res = Http::post($url, $postData, $cookie, $header);\n```\n\n## 三、参数解释\n\n###  1. GET方法\n| 参数  | 类型  |  描述 |\n| :------------ | :------------ | :------------ |\n| url | string  |  请求的url |\n| cookie |  string | 请求cookie  |\n| header | array  | 请求头数据  |\n| returnCookie | bool  | 是否返回cookie  |\n\n###  1. POST方法\n| 参数  | 类型  |  描述 |\n| :------------ | :------------ | :------------ |\n| url | string  |  请求的url |\n| data |  string\\|array | post数据  |\n| cookie |  string | 请求cookie  |\n| header | array  | 请求头数据  |\n| returnCookie | bool  | 是否返回cookie  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffishtailstudio%2Fhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffishtailstudio%2Fhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffishtailstudio%2Fhttp/lists"}