{"id":14954852,"url":"https://github.com/wordpress/requests","last_synced_at":"2026-04-09T00:02:55.104Z","repository":{"id":2410771,"uuid":"3378594","full_name":"WordPress/Requests","owner":"WordPress","description":"Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.","archived":false,"fork":false,"pushed_at":"2025-02-25T04:28:11.000Z","size":6401,"stargazers_count":3579,"open_issues_count":113,"forks_count":501,"subscribers_count":123,"default_branch":"develop","last_synced_at":"2025-04-29T15:33:09.320Z","etag":null,"topics":["curl","http","http-client","php","php-curl"],"latest_commit_sha":null,"homepage":"https://requests.ryanmccue.info/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WordPress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-02-07T15:37:48.000Z","updated_at":"2025-04-24T08:46:36.000Z","dependencies_parsed_at":"2023-01-13T11:50:28.094Z","dependency_job_id":"eeb242f3-3e3b-4218-b669-fa0854bf1eb7","html_url":"https://github.com/WordPress/Requests","commit_stats":{"total_commits":1222,"total_committers":77,"mean_commits":15.87012987012987,"dds":"0.49672667757774136","last_synced_commit":"7cb0c5c460bd7929195bc491ecb79eacae33bba6"},"previous_names":["rmccue/requests"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2FRequests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2FRequests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2FRequests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2FRequests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WordPress","download_url":"https://codeload.github.com/WordPress/Requests/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252552690,"owners_count":21766745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["curl","http","http-client","php","php-curl"],"created_at":"2024-09-24T13:09:31.213Z","updated_at":"2025-12-16T22:23:20.738Z","avatar_url":"https://github.com/WordPress.png","language":"PHP","readme":"Requests for PHP\n================\n\n[![CS](https://github.com/WordPress/Requests/actions/workflows/cs.yml/badge.svg)](https://github.com/WordPress/Requests/actions/workflows/cs.yml)\n[![Lint](https://github.com/WordPress/Requests/actions/workflows/lint.yml/badge.svg)](https://github.com/WordPress/Requests/actions/workflows/lint.yml)\n[![Test](https://github.com/WordPress/Requests/actions/workflows/test.yml/badge.svg)](https://github.com/WordPress/Requests/actions/workflows/test.yml)\n[![codecov.io](https://codecov.io/gh/WordPress/Requests/branch/stable/graph/badge.svg?token=AfpxK7WMxj\u0026branch=stable)](https://codecov.io/gh/WordPress/Requests?branch=stable)\n[![Packagist License](https://img.shields.io/packagist/l/rmccue/requests)](https://github.com/WordPress/Requests/blob/stable/LICENSE)\n\nRequests is a HTTP library written in PHP, for human beings. It is roughly\nbased on the API from the excellent [Requests Python\nlibrary](https://requests.readthedocs.io/en/latest/). Requests is [ISC\nLicensed](https://github.com/WordPress/Requests/blob/stable/LICENSE) (similar to\nthe new BSD license) and has no dependencies, except for PHP 5.6.20+.\n\nDespite PHP's use as a language for the web, its tools for sending HTTP requests\nare severely lacking. cURL has an\n[interesting API](https://www.php.net/curl-setopt), to say the\nleast, and you can't always rely on it being available. Sockets provide only low\nlevel access, and require you to build most of the HTTP response parsing\nyourself.\n\nWe all have better things to do. That's why Requests was born.\n\n```php\n$headers = array('Accept' =\u003e 'application/json');\n$options = array('auth' =\u003e array('user', 'pass'));\n$request = WpOrg\\Requests\\Requests::get('https://api.github.com/gists', $headers, $options);\n\nvar_dump($request-\u003estatus_code);\n// int(200)\n\nvar_dump($request-\u003eheaders['content-type']);\n// string(31) \"application/json; charset=utf-8\"\n\nvar_dump($request-\u003ebody);\n// string(26891) \"[...]\"\n```\n\nRequests allows you to send  **HEAD**, **GET**, **POST**, **PUT**, **DELETE**, \nand **PATCH** HTTP requests. You can add headers, form data, multipart files, \nand parameters with basic arrays, and access the response data in the same way.\nRequests uses cURL and fsockopen, depending on what your system has available, \nbut abstracts all the nasty stuff out of your way, providing a consistent API.\n\n\nFeatures\n--------\n\n- International Domains and URLs\n- Browser-style SSL Verification\n- Basic/Digest Authentication\n- Automatic Decompression\n- Connection Timeouts\n\n\nInstallation\n------------\n\n### Install with Composer\nIf you're using [Composer](https://getcomposer.org/) to manage\ndependencies, you can add Requests with it.\n\n```sh\ncomposer require rmccue/requests\n```\n\nor\n```json\n{\n    \"require\": {\n        \"rmccue/requests\": \"^2.0\"\n    }\n}\n```\n\n### Install source from GitHub\nTo install the source code:\n```bash\n$ git clone git://github.com/WordPress/Requests.git\n```\n\nNext, include the autoloader in your scripts:\n```php\nrequire_once '/path/to/Requests/src/Autoload.php';\n```\n\nYou'll probably also want to register the autoloader:\n```php\nWpOrg\\Requests\\Autoload::register();\n```\n\n### Install source from zip/tarball\nAlternatively, you can fetch a [tarball][] or [zipball][]:\n\n```bash\n$ curl -L https://github.com/WordPress/Requests/tarball/stable | tar xzv\n(or)\n$ wget https://github.com/WordPress/Requests/tarball/stable -O - | tar xzv\n```\n\n[tarball]: https://github.com/WordPress/Requests/tarball/stable\n[zipball]: https://github.com/WordPress/Requests/zipball/stable\n\n\n### Using a Class Loader\nIf you're using a class loader (e.g., [Symfony Class Loader][]) for\n[PSR-4][]-style class loading:\n```php\n$loader = new Psr4ClassLoader();\n$loader-\u003eaddPrefix('WpOrg\\\\Requests\\\\', 'path/to/vendor/Requests/src');\n$loader-\u003eregister();\n```\n\n[Symfony Class Loader]: https://github.com/symfony/ClassLoader\n[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4.md\n\n\nDocumentation\n-------------\nThe best place to start is our [prose-based documentation][], which will guide\nyou through using Requests.\n\nAfter that, take a look at [the documentation for\n`\\WpOrg\\Requests\\Requests::request()`][request_method], where all the parameters are fully\ndocumented.\n\nRequests is [100% documented with PHPDoc](https://requests.ryanmccue.info/api-2.x/).\nIf you find any problems with it, [create a new\nissue](https://github.com/WordPress/Requests/issues/new)!\n\n[prose-based documentation]: https://github.com/WordPress/Requests/blob/stable/docs/README.md\n[request_method]: https://requests.ryanmccue.info/api-2.x/classes/WpOrg-Requests-Requests.html#method_request\n\n\nTest Coverage\n-------------\n\nRequests strives to have 100% code-coverage of the library with an extensive\nset of tests. We're not quite there yet, but [we're getting close][codecov].\n\n[codecov]: https://codecov.io/github/WordPress/Requests/\n\n\nRequests and PSR-7/PSR-18\n-------------------------\n\n[PSR-7][psr-7] describes common interfaces for representing HTTP messages.\n[PSR-18][psr-18] describes a common interface for sending HTTP requests and receiving HTTP responses.\n\nBoth PSR-7 as well as PSR-18 were created after Requests' conception.\nAt this time, there is no intention to add a native PSR-7/PSR-18 implementation to the Requests library.\n\nHowever, the amazing [Artur Weigandt][art4] has created a [package][requests-psr-18], which allows you to use Requests as a PSR-7 compatible PSR-18 HTTP Client.\nIf you are interested in a PSR-7/PSR-18 compatible version of Requests, we highly recommend you check out [this package][requests-psr-18].\n\n[psr-7]:           https://www.php-fig.org/psr/psr-7/\n[psr-18]:          https://www.php-fig.org/psr/psr-18/\n[art4]:            https://github.com/Art4\n[requests-psr-18]: https://packagist.org/packages/art4/requests-psr18-adapter\n\n\nContribute\n----------\n\nContributions to this library are very welcome. Please read the [Contributing guidelines][] to get started.\n\n[Contributing guidelines]: https://github.com/WordPress/Requests/blob/develop/.github/CONTRIBUTING.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress%2Frequests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwordpress%2Frequests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress%2Frequests/lists"}