{"id":22292018,"url":"https://github.com/aedart/athenaeum-http-clients","last_synced_at":"2025-09-12T07:37:50.778Z","repository":{"id":56899564,"uuid":"234776086","full_name":"aedart/athenaeum-http-clients","owner":"aedart","description":"[READ ONLY] Athenaeum Http Clients package - see https://github.com/aedart/athenaeum","archived":false,"fork":false,"pushed_at":"2025-09-05T09:00:16.000Z","size":386,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T10:30:59.322Z","etag":null,"topics":["http-clients","manager","profiles","psr-7"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aedart.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-01-18T18:10:34.000Z","updated_at":"2025-09-05T09:00:20.000Z","dependencies_parsed_at":"2023-12-13T15:40:45.602Z","dependency_job_id":"ef521965-81ab-4982-aaf3-a5f5f85c55f8","html_url":"https://github.com/aedart/athenaeum-http-clients","commit_stats":{"total_commits":462,"total_committers":2,"mean_commits":231.0,"dds":0.1298701298701299,"last_synced_commit":"9d06122a758fda8094eae5a2e80a663c88a3f586"},"previous_names":[],"tags_count":150,"template":false,"template_full_name":null,"purl":"pkg:github/aedart/athenaeum-http-clients","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aedart%2Fathenaeum-http-clients","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aedart%2Fathenaeum-http-clients/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aedart%2Fathenaeum-http-clients/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aedart%2Fathenaeum-http-clients/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aedart","download_url":"https://codeload.github.com/aedart/athenaeum-http-clients/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aedart%2Fathenaeum-http-clients/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273858316,"owners_count":25180763,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"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":["http-clients","manager","profiles","psr-7"],"created_at":"2024-12-03T17:19:18.258Z","updated_at":"2025-09-12T07:37:50.749Z","avatar_url":"https://github.com/aedart.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Athenaeum Http Clients\n\nThis package offers a Http Client wrapper, with a powerful fluent request builder that is able to use different Http Query grammars, supporting both [Json Api](https://jsonapi.org/) and [OData](https://www.odata.org/).\nIn addition, it also comes with a manager that allows you to handle multiple http client \"profiles\".\nThis allows you to segment each api you communicate with, into it's own client instance.\n\n[Guzzle Http Client](http://docs.guzzlephp.org/en/stable/index.html) is used behind the scene.\n\n## Example\n\n## Configuration\n\n\n```php\nreturn [\n\n    'profiles' =\u003e [\n\n        'my-client' =\u003e [\n            'driver'    =\u003e \\Aedart\\Http\\Clients\\Drivers\\JsonHttpClient::class,\n            'options'   =\u003e [\n                'base_uri' =\u003e 'https://acme.com/api/v2'\n            ]\n        ],\n    ]\n    \n    // ... remaining not shown ...\n];\n```\n\n### Usage\n\n```php\nuse Aedart\\Http\\Clients\\Traits\\HttpClientsManagerTrait;\nuse Aedart\\Contracts\\Http\\Clients\\Responses\\Status;\nuse Teapot\\StatusCode;\nuse DateTime;\n\nclass CurrencyController\n{\n    use HttpClientsManagerTrait;\n    \n    public function index()\n    {\n        $client = $this-\u003egetHttpClientsManager()-\u003eprofile('my-client');\n        \n        // Perform a GET request\n        $response = $client\n            -\u003euseTokenAuth('my-secret-api-token')\n            -\u003ewhere('currency', 'DKK')\n            -\u003ewhereDate('date', new DateTime('now'))\n            -\u003eexpect(StatusCode::OK, function(Status $status){\n                throw new RuntimeException('API is not available: ' . $status);\n            })\n            -\u003eget('/currencies');\n        \n        // ...remaining not shown\n    }\n}\n```\n\n## Motivation\n\nA Http Client \"package\" was made available in version 3.x of the Athenaeum library.\nIt offered the manager to handle multiple \"profiles\" and some fluent methods for gradually building a request.\nBut it was not as comprehensive as the current version.\nWhen Laravel released it's v7.x version, it came with a custom [Http Client](https://laravel.com/docs/7.x/http-client#introduction).\nTherefore, this package became somewhat irrelevant and was considered for deprecation.\nUltimately, I decided to redesign this package entirely, mixing some of the already provided features with lots of new ones.\n\nAs a result, this package now draws inspiration from both Laravel's Http Client, as well as the [Database Query Builder](https://laravel.com/docs/7.x/queries#introduction).\nYou will find many similarities between the client offered by Laravel, and the one provided by this package.\nThe intent isn't to copy Laravel's Http Client, but rather to provide a slightly different approach on request building.\n\nWhen considering whether to use this Http Client, Laravel's or other Http Client, then it's probably best to stick with what you feel most comfortable with. \nTo put a different perspective on this matter, consider that Laravel has a far better support for their packages, than I can currently offer.\n\n## Documentation\n\nPlease read the [official documentation](https://aedart.github.io/athenaeum/) for additional information.\n\n## Repository\n\nThe mono repository is located at [github.com/aedart/athenaeum](https://github.com/aedart/athenaeum)\n\n## Versioning\n\nThis package follows [Semantic Versioning 2.0.0](http://semver.org/)\n\n## License\n\n[BSD-3-Clause](http://spdx.org/licenses/BSD-3-Clause), Read the LICENSE file included in this package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faedart%2Fathenaeum-http-clients","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faedart%2Fathenaeum-http-clients","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faedart%2Fathenaeum-http-clients/lists"}