{"id":33984422,"url":"https://github.com/middlewares/csv-payload","last_synced_at":"2025-12-13T04:29:40.020Z","repository":{"id":62528416,"uuid":"138627175","full_name":"middlewares/csv-payload","owner":"middlewares","description":"PSR-15 middleware to parse the CSV body of the request","archived":false,"fork":false,"pushed_at":"2025-04-02T10:23:59.000Z","size":49,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-12T11:26:04.706Z","etag":null,"topics":["csv","http","middleware","payload","psr-15"],"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/middlewares.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":"2018-06-25T17:20:03.000Z","updated_at":"2025-04-02T10:24:02.000Z","dependencies_parsed_at":"2025-03-29T23:21:23.572Z","dependency_job_id":"87bf0b50-9f82-4ca0-9e3d-b76996584ced","html_url":"https://github.com/middlewares/csv-payload","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/middlewares/csv-payload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middlewares%2Fcsv-payload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middlewares%2Fcsv-payload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middlewares%2Fcsv-payload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middlewares%2Fcsv-payload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/middlewares","download_url":"https://codeload.github.com/middlewares/csv-payload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middlewares%2Fcsv-payload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27699832,"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-12-13T02:00:09.769Z","response_time":147,"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":["csv","http","middleware","payload","psr-15"],"created_at":"2025-12-13T04:29:39.502Z","updated_at":"2025-12-13T04:29:40.013Z","avatar_url":"https://github.com/middlewares.png","language":"PHP","readme":"# middlewares/csv-payload\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE)\n![Testing][ico-ga]\n[![Total Downloads][ico-downloads]][link-downloads]\n\nExtends [middlewares/payload][link-payload] to add support for parsing the CSV body of the request.\n\n## Requirements\n\n* PHP \u003e= 7.0\n* A [PSR-7](https://packagist.org/providers/psr/http-message-implementation) http message implementation ([Diactoros](https://github.com/zendframework/zend-diactoros), [Guzzle](https://github.com/guzzle/psr7), [Slim](https://github.com/slimphp/Slim), etc...)\n* A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher)\n\n## Installation\n\nThis package is installable and autoloadable via Composer as [middlewares/csv-payload](https://packagist.org/packages/middlewares/csv-payload).\n\n```sh\ncomposer require middlewares/csv-payload\n```\n\n## CsvPayload\n\nParses the CSV payload of the request. Uses [league/csv][link-csv] to read the CSV values. Contains the following options to configure the CSV [`Reader`][link-csv-reader] object:\n\n#### `delimiter($delimiter)`\n\nTo configure the CSV delimiter control character (one character only). If the submitted character is invalid an `InvalidArgumentException` exception is thrown.\n\n#### `enclosure($enclosure)`\n\nTo configure the CSV enclosure control character (one character only). If the submitted character is invalid an `InvalidArgumentException` exception is thrown.\n\n#### `escape($escape)`\n\nTo configure the CSV escape control character (one character only). If the submitted character is invalid an `InvalidArgumentException` exception is thrown.\n\n#### `header($header)`\n\nTo configure the CSV header line. If the submitted header value is less than 0 an `InvalidArgumentException` exception is thrown.\n\n#### `methods(array $methods)`\n\nTo configure the allowed methods. By default only the requests with the method `POST, PUT, PATCH, DELETE, COPY, LOCK, UNLOCK` are handled.\n\n#### `contentType(array $contentType)`\n\nTo configure all Content-Type headers used in the request. By default is `text/csv`\n\n#### `override($override = true)`\n\nTo override the previous parsed body if exists (`false` by default)\n\n```php\n$dispatcher = new Dispatcher([\n    (new \\Middlewares\\CsvPayload())\n        -\u003edelimiter(\";\")\n        -\u003eenclosure(\"'\")\n        -\u003eescape(\"\\\\\")\n]);\n\n$response = $dispatcher-\u003edispatch(new ServerRequest());\n```\n\n---\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information about recent changes and [CONTRIBUTING](CONTRIBUTING.md) for contributing details.\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/middlewares/csv-payload.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-ga]: https://github.com/middlewares/csv-payload/workflows/testing/badge.svg\n[ico-downloads]: https://img.shields.io/packagist/dt/middlewares/csv-payload.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/middlewares/csv-payload\n[link-downloads]: https://packagist.org/packages/middlewares/csv-payload\n[link-payload]: https://packagist.org/packages/middlewares/payload\n[link-csv]: https://packagist.org/packages/league/csv\n[link-csv-reader]: http://csv.thephpleague.com/9.0/reader/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiddlewares%2Fcsv-payload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiddlewares%2Fcsv-payload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiddlewares%2Fcsv-payload/lists"}