{"id":13395560,"url":"https://github.com/nategood/httpful","last_synced_at":"2026-10-19T11:46:19.180Z","repository":{"id":2154422,"uuid":"3099649","full_name":"nategood/httpful","owner":"nategood","description":"A Chainable, REST Friendly, PHP HTTP Client.  A sane alternative to cURL.","archived":false,"fork":false,"pushed_at":"2025-10-24T12:11:35.000Z","size":517,"stargazers_count":1764,"open_issues_count":88,"forks_count":298,"subscribers_count":77,"default_branch":"master","last_synced_at":"2026-10-15T09:19:45.572Z","etag":null,"topics":[],"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/nategood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-01-04T04:31:56.000Z","updated_at":"2026-10-01T13:47:26.000Z","dependencies_parsed_at":"2022-08-09T09:03:28.511Z","dependency_job_id":"ffca10f3-4cd4-4df8-81c9-313723b056d6","html_url":"https://github.com/nategood/httpful","commit_stats":{"total_commits":273,"total_committers":60,"mean_commits":4.55,"dds":0.5201465201465201,"last_synced_commit":"0cded3ea97ba905600de9ceb9ef13f3ab681587c"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/nategood/httpful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nategood%2Fhttpful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nategood%2Fhttpful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nategood%2Fhttpful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nategood%2Fhttpful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nategood","download_url":"https://codeload.github.com/nategood/httpful/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nategood%2Fhttpful/sbom","scorecard":{"id":675190,"data":{"date":"2025-08-11","repo":{"name":"github.com/nategood/httpful","commit":"ea02c8aedef70b9a453ce97978d9d7c413972f15"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":6,"reason":"Found 10/16 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/nategood/httpful/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/nategood/httpful/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/nategood/httpful/ci.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T21:14:28.377Z","repository_id":2154422,"created_at":"2025-08-21T21:14:28.378Z","updated_at":"2025-08-21T21:14:28.378Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38352886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-07-30T18:00:24.070Z","updated_at":"2026-10-19T11:46:18.907Z","avatar_url":"https://github.com/nategood.png","language":"PHP","funding_links":[],"categories":["HTTP Libraries-","HTTP","超文本传输协议 HTTP","PHP","Client","目录","Web"],"sub_categories":["Laravel  docs","HTTP客户端 HTTP Client","HTTP and Networking Clients"],"readme":"# Httpful\n\nHttpful is a simple Http Client library for PHP 8.0+. There is an emphasis of readability, simplicity, and flexibility – basically provide the features and flexibility to get the job done and make those features really easy to use.\n\nFeatures\n\n- Readable HTTP Method Support (GET, PUT, POST, DELETE, HEAD, PATCH and OPTIONS)\n- Custom Headers\n- Automatic \"Smart\" Parsing\n- Automatic Payload Serialization\n- Basic Auth\n- Client Side Certificate Auth\n- Request \"Templates\"\n\n# Sneak Peak\n\nHere's something to whet your appetite. Search the twitter API for tweets containing \"#PHP\". Include a trivial header for the heck of it. Notice that the library automatically interprets the response as JSON (can override this if desired) and parses it as an array of objects.\n\n```php\n\n// Make a request to the GitHub API with a custom\n// header of \"X-Trvial-Header: Just as a demo\".\n$url = \"https://api.github.com/users/nategood\";\n$response = \\Httpful\\Request::get($url)\n    -\u003eexpectsJson()\n    -\u003ewithXTrivialHeader('Just as a demo')\n    -\u003esend();\n\necho \"{$response-\u003ebody-\u003ename} joined GitHub on \" .\n                        date('M jS', strtotime($response-\u003ebody-\u003ecreated_at)) .\"\\n\";\n```\n\n# Installation\n\n## Composer\n\nHttpful is PSR-0 compliant and can be installed using [composer](http://getcomposer.org/). Simply add `nategood/httpful` to your composer.json file. _Composer is the sane alternative to PEAR. It is excellent for managing dependencies in larger projects_.\n\n    {\n        \"require\": {\n            \"nategood/httpful\": \"*\"\n        }\n    }\n\n## Install from Source\n\nBecause Httpful is PSR-0 compliant, you can also just clone the Httpful repository and use a PSR-0 compatible autoloader to load the library, like [Symfony's](http://symfony.com/doc/current/components/class_loader.html). Alternatively you can use the PSR-0 compliant autoloader included with the Httpful (simply `require(\"bootstrap.php\")`).\n\n## Build your Phar\n\nIf you want the build your own [Phar Archive](http://php.net/manual/en/book.phar.php) you can use the `build` script included.\nMake sure that your `php.ini` has the _Off_ or 0 value for the `phar.readonly` setting.\nAlso you need to create an empty `downloads` directory in the project root.\n\n# Contributing\n\nHttpful highly encourages sending in pull requests. When submitting a pull request please:\n\n- All pull requests should target the `dev` branch (not `master`)\n- Make sure your code follows the [coding conventions](http://pear.php.net/manual/en/standards.php)\n- Please use soft tabs (four spaces) instead of hard tabs\n- Make sure you add appropriate test coverage for your changes\n- Run all unit tests in the test directory via `phpunit ./tests`\n- Include commenting where appropriate and add a descriptive pull request message\n\n# Changelog\n\n## 1.0.0\n\n- SECURITY [Make certificate validation the default](https://huntr.com/bounties/8d59c089-92f1-4b73-90f8-54968a70e2fb). This is a potentially breaking change and as a result, bumping major version number in line with semver. Validation can still be skipped but must be explicitly skipped via withoutStrictSSL.\n- REFACTOR [PR #305](https://github.com/nategood/httpful/pull/305) Remove deprecated functionality pre PHP 8.1\n- REFACTOR Partially from [PR #282](https://github.com/nategood/httpful/pull/282) Add CI support for running tests now that Travis is gone.\n\n## 0.3.2\n\n- REFACTOR [PR #276](https://github.com/nategood/httpful/pull/276) Add properly subclassed, more descriptive Exceptions for JSON parse errors\n\n## 0.3.1\n\n- FIX [PR #286](https://github.com/nategood/httpful/pull/286) Fixed header case sensitivity\n\n## 0.3.0\n\n- REFACTOR Dropped support for dead versions of PHP. Updated the PHPUnit tests.\n\n## 0.2.20\n\n- MINOR Move Response building logic into separate function [PR #193](https://github.com/nategood/httpful/pull/193)\n\n## 0.2.19\n\n- FEATURE Before send hook [PR #164](https://github.com/nategood/httpful/pull/164)\n- MINOR More descriptive connection exceptions [PR #166](https://github.com/nategood/httpful/pull/166)\n\n## 0.2.18\n\n- FIX [PR #149](https://github.com/nategood/httpful/pull/149)\n- FIX [PR #150](https://github.com/nategood/httpful/pull/150)\n- FIX [PR #156](https://github.com/nategood/httpful/pull/156)\n\n## 0.2.17\n\n- FEATURE [PR #144](https://github.com/nategood/httpful/pull/144) Adds additional parameter to the Response class to specify additional meta data about the request/response (e.g. number of redirect).\n\n## 0.2.16\n\n- FEATURE Added support for whenError to define a custom callback to be fired upon error. Useful for logging or overriding the default error_log behavior.\n\n## 0.2.15\n\n- FEATURE [I #131](https://github.com/nategood/httpful/pull/131) Support for SOCKS proxy\n\n## 0.2.14\n\n- FEATURE [I #138](https://github.com/nategood/httpful/pull/138) Added alternative option for XML request construction. In the next major release this will likely supplant the older version.\n\n## 0.2.13\n\n- REFACTOR [I #121](https://github.com/nategood/httpful/pull/121) Throw more descriptive exception on curl errors\n- REFACTOR [I #122](https://github.com/nategood/httpful/issues/122) Better proxy scrubbing in Request\n- REFACTOR [I #119](https://github.com/nategood/httpful/issues/119) Better document the mimeType param on Request::body\n- Misc code and test cleanup\n\n## 0.2.12\n\n- REFACTOR [I #123](https://github.com/nategood/httpful/pull/123) Support new curl file upload method\n- FEATURE [I #118](https://github.com/nategood/httpful/pull/118) 5.4 HTTP Test Server\n- FIX [I #109](https://github.com/nategood/httpful/pull/109) Typo\n- FIX [I #103](https://github.com/nategood/httpful/pull/103) Handle also CURLOPT_SSL_VERIFYHOST for strictSsl mode\n\n## 0.2.11\n\n- FIX [I #99](https://github.com/nategood/httpful/pull/99) Prevent hanging on HEAD requests\n\n## 0.2.10\n\n- FIX [I #93](https://github.com/nategood/httpful/pull/86) Fixes edge case where content-length would be set incorrectly\n\n## 0.2.9\n\n- FEATURE [I #89](https://github.com/nategood/httpful/pull/89) multipart/form-data support (a.k.a. file uploads)! Thanks @dtelaroli!\n\n## 0.2.8\n\n- FIX Notice fix for Pull Request 86\n\n## 0.2.7\n\n- FIX [I #86](https://github.com/nategood/httpful/pull/86) Remove Connection Established header when using a proxy\n\n## 0.2.6\n\n- FIX [I #85](https://github.com/nategood/httpful/issues/85) Empty Content Length issue resolved\n\n## 0.2.5\n\n- FEATURE [I #80](https://github.com/nategood/httpful/issues/80) [I #81](https://github.com/nategood/httpful/issues/81) Proxy support added with `useProxy` method.\n\n## 0.2.4\n\n- FEATURE [I #77](https://github.com/nategood/httpful/issues/77) Convenience method for setting a timeout (seconds) `$req-\u003etimeoutIn(10);`\n- FIX [I #75](https://github.com/nategood/httpful/issues/75) [I #78](https://github.com/nategood/httpful/issues/78) Bug with checking if digest auth is being used.\n\n## 0.2.3\n\n- FIX Overriding default Mime Handlers\n- FIX [PR #73](https://github.com/nategood/httpful/pull/73) Parsing http status codes\n\n## 0.2.2\n\n- FEATURE Add support for parsing JSON responses as associative arrays instead of objects\n- FEATURE Better support for setting constructor arguments on Mime Handlers\n\n## 0.2.1\n\n- FEATURE [PR #72](https://github.com/nategood/httpful/pull/72) Allow support for custom Accept header\n\n## 0.2.0\n\n- REFACTOR [PR #49](https://github.com/nategood/httpful/pull/49) Broke headers out into their own class\n- REFACTOR [PR #54](https://github.com/nategood/httpful/pull/54) Added more specific Exceptions\n- FIX [PR #58](https://github.com/nategood/httpful/pull/58) Fixes throwing an error on an empty xml response\n- FEATURE [PR #57](https://github.com/nategood/httpful/pull/57) Adds support for digest authentication\n\n## 0.1.6\n\n- Ability to set the number of max redirects via overloading `followRedirects(int max_redirects)`\n- Standards Compliant fix to `Accepts` header\n- Bug fix for bootstrap process when installed via Composer\n\n## 0.1.5\n\n- Use `DIRECTORY_SEPARATOR` constant [PR #33](https://github.com/nategood/httpful/pull/32)\n- [PR #35](https://github.com/nategood/httpful/pull/35)\n- Added the raw_headers property reference to response.\n- Compose request header and added raw_header to Request object.\n- Fixed response has errors and added more comments for clarity.\n- Fixed header parsing to allow the minimum (status line only) and also cater for the actual CRLF ended headers as per RFC2616.\n- Added the perfect test Accept: header for all Acceptable scenarios see @b78e9e82cd9614fbe137c01bde9439c4e16ca323 for details.\n- Added default User-Agent header\n- `User-Agent: Httpful/0.1.5` + curl version + server software + PHP version\n- To bypass this \"default\" operation simply add a User-Agent to the request headers even a blank User-Agent is sufficient and more than simple enough to produce me thinks.\n- Completed test units for additions.\n- Added phpunit coverage reporting and helped phpunit auto locate the tests a bit easier.\n\n## 0.1.4\n\n- Add support for CSV Handling [PR #32](https://github.com/nategood/httpful/pull/32)\n\n## 0.1.3\n\n- Handle empty responses in JsonParser and XmlParser\n\n## 0.1.2\n\n- Added support for setting XMLHandler configuration options\n- Added examples for overriding XmlHandler and registering a custom parser\n- Removed the httpful.php download (deprecated in favor of httpful.phar)\n\n## 0.1.1\n\n- Bug fix serialization default case and phpunit tests\n\n## 0.1.0\n\n- Added Support for Registering Mime Handlers\n- Created AbstractMimeHandler type that all Mime Handlers must extend\n- Pulled out the parsing/serializing logic from the Request/Response classes into their own MimeHandler classes\n- Added ability to register new mime handlers for mime types\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnategood%2Fhttpful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnategood%2Fhttpful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnategood%2Fhttpful/lists"}