{"id":30716968,"url":"https://github.com/dlzer/http-utils","last_synced_at":"2025-09-03T08:29:55.876Z","repository":{"id":56970078,"uuid":"412591176","full_name":"DLzer/http-utils","owner":"DLzer","description":"Common HTTP Utilities for PHP Request and Response in PSR-7","archived":false,"fork":false,"pushed_at":"2021-10-01T19:36:17.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-29T10:22:44.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DLzer.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":"2021-10-01T19:16:06.000Z","updated_at":"2024-04-29T10:22:44.354Z","dependencies_parsed_at":"2022-08-21T10:50:39.844Z","dependency_job_id":null,"html_url":"https://github.com/DLzer/http-utils","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DLzer/http-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fhttp-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fhttp-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fhttp-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fhttp-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DLzer","download_url":"https://codeload.github.com/DLzer/http-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fhttp-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273413520,"owners_count":25101214,"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-03T02:00:09.631Z","response_time":76,"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":"2025-09-03T08:29:50.113Z","updated_at":"2025-09-03T08:29:55.859Z","avatar_url":"https://github.com/DLzer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PSR Http Message Utilities\n![GitHub](https://img.shields.io/github/license/DLzer/http-utils?label=License\u0026style=flat-square)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/DLzer/http-utils?style=flat-square)\n\n\nUtility classes and constants to provide quick reference usage for request methods and responses.\n\n## Installation\n\n```bash\ncompose require dlzer/http-utils\n```\n\n## Usage\n\nWhen used in conjunction with [PHP-FIG](https://github.com/php-fig/http-message-util) Status Code Interface.\n\n```php\n// Custom responder method\npublic function withJson(\n    ResponseInterface $response,\n    $statusCode, \n    $message, \n    $data = null, \n    int $options = 0\n    ): ResponseInterface\n{\n    return $response-\u003ewrite(json_encode([\n        \"status\" =\u003e $statusCode,\n        \"message\" =\u003e $message,\n        \"data\" =\u003e $data\n    ], $options);\n    );\n}\n\n// Usage\n$data = [\"connection\" =\u003e true];\nreturn $this-\u003eresponder-\u003ewithJson(\n    $response, // The response interface\n    StatusCodeInterface::STATUS_OK // The status code interface\n    StatusCodeMessage::STATUS_OK // The status message interface: \"OK\"\n    $data // The response data\n);\n\n```\n\nOutput:\n```json\n{\n    \"status\": 200,\n    \"message\": \"OK\",\n    \"data\": {\n        \"connection\": true\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlzer%2Fhttp-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlzer%2Fhttp-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlzer%2Fhttp-utils/lists"}