{"id":18779877,"url":"https://github.com/tal7aouy/yusr","last_synced_at":"2025-04-13T11:30:38.419Z","repository":{"id":257823656,"uuid":"868610254","full_name":"tal7aouy/yusr","owner":"tal7aouy","description":"🚀 Yusr: A lightweight, powerful PHP HTTP client inspired by Guzzle","archived":false,"fork":false,"pushed_at":"2024-12-08T12:53:52.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T02:51:16.937Z","etag":null,"topics":["guzzle","guzzlehttp","http","http-client","php-http-client","php-https"],"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/tal7aouy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2024-10-06T20:13:48.000Z","updated_at":"2024-12-08T12:53:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a4984ac-25fe-4f33-9837-4af859b89eb4","html_url":"https://github.com/tal7aouy/yusr","commit_stats":null,"previous_names":["tal7aouy/yusr"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tal7aouy%2Fyusr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tal7aouy%2Fyusr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tal7aouy%2Fyusr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tal7aouy%2Fyusr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tal7aouy","download_url":"https://codeload.github.com/tal7aouy/yusr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248705481,"owners_count":21148545,"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":["guzzle","guzzlehttp","http","http-client","php-http-client","php-https"],"created_at":"2024-11-07T20:23:36.237Z","updated_at":"2025-04-13T11:30:38.021Z","avatar_url":"https://github.com/tal7aouy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 🚀 YusrClient - A Powerful PHP HTTP Client\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"art/logo.png\" alt=\"YusrClient Logo\" width=\"200\"\u003e\n\u003c/p\u003e\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/tal7aouy/yusr.svg?style=flat-square)](https://packagist.org/packages/tal7aouy/yusr)\n[![Total Downloads](https://img.shields.io/packagist/dt/tal7aouy/yusr.svg?style=flat-square)](https://packagist.org/packages/tal7aouy/yusr)\n[![License](https://img.shields.io/packagist/l/tal7aouy/yusr.svg?style=flat-square)](https://packagist.org/packages/tal7aouy/yusr)\n\nYusrClient is a robust and easy-to-use PHP HTTP client that simplifies making HTTP requests in your PHP applications. Built with modern PHP practices, it implements the PSR-18 HTTP Client interface and provides a fluent API for sending HTTP requests.\n\n## ✨ Key Features\n\n- 🔒 PSR-18 HTTP Client compliant\n- 🛠 Singleton pattern implementation\n- 🚦 Full HTTP method support (GET, POST, PUT, DELETE, PATCH)\n- 🔄 Automatic retry mechanism with exponential backoff\n- 🔧 Highly customizable request options\n- 🧩 Intuitive fluent interface\n- ⏱ Configurable timeouts\n- 🔐 SSL verification support\n\n## 📦 Installation\n\n```bash\ncomposer require tal7aouy/yusr\n```\n\n## 🚀 Quick Start\n\n```php\nuse Yusr\\Http\\YusrClient;\n\n// Get client instance\n$client = YusrClient::getInstance();\n\n// Make a GET request\n$response = $client-\u003eget('https://api.example.com/users');\n\n// Work with response\n$statusCode = $response-\u003egetStatusCode();\n$data = $response-\u003egetBody()-\u003egetContents();\n$headers = $response-\u003egetHeaders();\n```\n\n## ⚙️ Configuration\n\n```php\n$client = YusrClient::getInstance([\n    'timeout' =\u003e 30,\n    'allow_redirects' =\u003e true,\n    'verify' =\u003e true,\n    'retry' =\u003e [\n        'max_attempts' =\u003e 3,\n        'delay' =\u003e 1000 // milliseconds\n    ]\n]);\n```\n\n## 📘 Available Methods\n\n### HTTP Methods\n```php\n$client-\u003eget(string $uri, array $options = []);\n$client-\u003epost(string $uri, array $options = []);\n$client-\u003eput(string $uri, array $options = []);\n$client-\u003edelete(string $uri, array $options = []);\n$client-\u003epatch(string $uri, array $options = []);\n```\n\n### Request Options\n- `query` - Array of URL query parameters\n- `headers` - Custom request headers\n- `body` - Request body (for POST, PUT, PATCH)\n- `timeout` - Request timeout in seconds\n- `allow_redirects` - Follow redirects (boolean)\n- `verify` - SSL certificate verification\n- `retry` - Retry configuration for failed requests\n\n## 🔄 Retry Mechanism\n\nYusrClient includes a sophisticated retry mechanism with exponential backoff:\n\n```php\n$client = YusrClient::getInstance([\n    'retry' =\u003e [\n        'max_attempts' =\u003e 3,\n        'delay' =\u003e 1000,\n        'multiplier' =\u003e 2\n    ]\n]);\n```\n\n## 🤝 Contributing\n\nContributions are always welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## 📝 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## 🙏 Support\n\nIf you find this package helpful, please consider giving it a star ⭐️","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftal7aouy%2Fyusr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftal7aouy%2Fyusr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftal7aouy%2Fyusr/lists"}