Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geggleto/request-factory
Turn raw HTTP Strings into PSR-7 Requests
https://github.com/geggleto/request-factory
Last synced: 5 days ago
JSON representation
Turn raw HTTP Strings into PSR-7 Requests
- Host: GitHub
- URL: https://github.com/geggleto/request-factory
- Owner: geggleto
- Created: 2015-11-24T20:51:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-25T18:31:54.000Z (almost 9 years ago)
- Last Synced: 2024-04-18T11:21:02.718Z (7 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# request-factory
Turn raw HTTP Strings into PSR-7 Requests# Usage
```php
// ...
use \Geggleto\Foundation\Factory\ServerRequestFactory;$factory = new ServerRequestFactory();
$request = $factory->parseFromString("GET /docs/index.html HTTP/1.1
Host: http://www.test101.com
Accept: image/gif, image/jpeg, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");// $request is PSR-7!
```