{"id":18849926,"url":"https://github.com/asispts/http-accept","last_synced_at":"2025-04-14T09:21:21.731Z","repository":{"id":40597330,"uuid":"290419587","full_name":"asispts/http-accept","owner":"asispts","description":"PHP Parser to deal with HTTP Accept, Accept-Language, Accept-Encoding, and Content-Type headers","archived":false,"fork":false,"pushed_at":"2023-04-28T02:59:49.000Z","size":96,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-15T11:51:40.998Z","etag":null,"topics":["accept","accept-encoding","accept-language","content-type","http-header-parser","http-headers"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asispts.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-08-26T06:53:13.000Z","updated_at":"2024-01-16T19:05:51.000Z","dependencies_parsed_at":"2024-11-08T03:31:38.690Z","dependency_job_id":"88dc2cfd-097e-4d4d-8fe8-37a3a4e93f24","html_url":"https://github.com/asispts/http-accept","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asispts%2Fhttp-accept","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asispts%2Fhttp-accept/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asispts%2Fhttp-accept/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asispts%2Fhttp-accept/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asispts","download_url":"https://codeload.github.com/asispts/http-accept/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248204871,"owners_count":21064934,"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":["accept","accept-encoding","accept-language","content-type","http-header-parser","http-headers"],"created_at":"2024-11-08T03:26:57.003Z","updated_at":"2025-04-14T09:21:21.703Z","avatar_url":"https://github.com/asispts.png","language":"PHP","readme":"[![Build](https://github.com/asispts/http-accept/actions/workflows/ci.yml/badge.svg)](https://github.com/asispts/http-accept/actions/workflows/ci.yml)\n[![Packagist PHP Version](https://img.shields.io/packagist/dependency-v/asispts/http-accept/php)](https://packagist.org/packages/asispts/http-accept)\n[![Packagist Version](https://img.shields.io/packagist/v/asispts/http-accept?label=stable)](https://packagist.org/packages/asispts/http-accept)\n[![License](https://img.shields.io/github/license/asispts/http-accept)](./LICENSE)\n\n\n# `http-accept` parser\n`http-accept` is a PHP parser designed to handle HTTP headers related to content negotiation. These headers include `Accept`, `Accept-Language`, `Accept-Encoding`, and `Content-Type`. The library provides parser classes for each of these headers, making it easy to extract the relevant information from incoming HTTP requests.\n\n## Installation\nYou can install this library using [composer](https://getcomposer.org/).\n```bash\ncomposer require asispts/http-accept\n```\n\n## Usage\nTo parse the different headers, use the corresponding parser class.\n\n### Parse `Content-Type`\n```php\n$contentType = (new ContentTypeParser())-\u003eparse($source);\n```\n\n### Parse HTTP `Accept`\n```php\n$types = (new AcceptParser())-\u003eparse($source);\n```\n\n### Parse `Accept-Language`\n```php\n$languages = (new AcceptLanguageParser())-\u003eparse($source);\n```\n\n### Parse `Accept-Encoding`\n```php\n$encodings = (new AcceptEncodingParser())-\u003eparse($source);\n```\n\n## Contributing\nAll forms of contributions are welcome, including bug reports, feature requests, and pull requests. If you plan to make major changes, please open an issue first to discuss what you would like to change.\n\n## License\nReleased under [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0). See [LICENSE](./LICENSE) file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasispts%2Fhttp-accept","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasispts%2Fhttp-accept","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasispts%2Fhttp-accept/lists"}