{"id":19665926,"url":"https://github.com/amphp/http-server-form-parser","last_synced_at":"2025-04-28T22:31:30.470Z","repository":{"id":30532115,"uuid":"125274358","full_name":"amphp/http-server-form-parser","owner":"amphp","description":"An HTTP server plugin that simplifies form data handling. Effortlessly parse incoming form submissions and extracting its data.","archived":false,"fork":false,"pushed_at":"2023-08-25T03:00:49.000Z","size":137,"stargazers_count":18,"open_issues_count":1,"forks_count":6,"subscribers_count":7,"default_branch":"2.x","last_synced_at":"2025-04-20T22:33:29.312Z","etag":null,"topics":["amphp","form","forms","html","http","http-server","multipart-formdata","parser","php","x-www-form-urlencoded"],"latest_commit_sha":null,"homepage":"https://amphp.org/http-server-form-parser","language":"HTML","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/amphp.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}},"created_at":"2018-03-14T21:14:40.000Z","updated_at":"2025-03-02T14:29:15.000Z","dependencies_parsed_at":"2024-06-18T18:31:08.162Z","dependency_job_id":null,"html_url":"https://github.com/amphp/http-server-form-parser","commit_stats":{"total_commits":91,"total_committers":7,"mean_commits":13.0,"dds":0.4505494505494505,"last_synced_commit":"6f160914a1cd9aaa104b589c0c590613600bfa70"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-server-form-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-server-form-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-server-form-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fhttp-server-form-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amphp","download_url":"https://codeload.github.com/amphp/http-server-form-parser/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251397606,"owners_count":21583041,"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":["amphp","form","forms","html","http","http-server","multipart-formdata","parser","php","x-www-form-urlencoded"],"created_at":"2024-11-11T16:25:28.898Z","updated_at":"2025-04-28T22:31:28.865Z","avatar_url":"https://github.com/amphp.png","language":"HTML","readme":"# http-server-form-parser\n\nThis package is an add-on to [`amphp/http-server`](https://github.com/amphp/http-server), which allows parsing request bodies as forms in either `x-www-form-urlencoded` or `multipart/form-data` format.\n\n## Installation\n\nThis package can be installed as a [Composer](https://getcomposer.org/) dependency.\n\n```bash\ncomposer require amphp/http-server-form-parser\n```\n\n## Usage\n\nBasic usage works by calling `Form::fromRequest($request)`, which will buffer the request body and parse it. This method may be called multiple times, so both a [middleware](https://github.com/amphp/http-server#middleware) and [request handler](https://github.com/amphp/http-server#requesthandler) may access the form body.\n\n```php\nuse Amp\\Http\\Server\\FormParser\\Form;\nuse Amp\\Http\\Server\\Request;\nuse Amp\\Http\\Server\\RequestHandler\\ClosureRequestHandler;\nuse Amp\\Http\\Server\\Response;\nuse Amp\\Http\\Status;\n\n$requestHandler = new ClosureRequestHandler(function (Request $request) {\n    $form = Form::fromRequest($request);\n\n    return new Response(Status::OK, [\n        \"content-type\" =\u003e \"text/plain; charset=utf-8\"\n    ], $form-\u003egetValue(\"text\") ?? \"Hello, World!\");\n});\n```\n\nThere's also an advanced streaming parser included, `StreamingFormParser`, which can be used to stream uploaded files to disk or other locations.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fhttp-server-form-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famphp%2Fhttp-server-form-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fhttp-server-form-parser/lists"}