https://github.com/geggleto/request-factory
Turn raw HTTP Strings into PSR-7 Requests
https://github.com/geggleto/request-factory
Last synced: 4 months 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 (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-25T18:31:54.000Z (over 9 years ago)
- Last Synced: 2025-01-14T10:14:44.686Z (6 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!
```