An open API service indexing awesome lists of open source software.

https://github.com/omissis/psr-http

Set of interfaces for PSR-HTTP proposal
https://github.com/omissis/psr-http

Last synced: 8 months ago
JSON representation

Set of interfaces for PSR-HTTP proposal

Awesome Lists containing this project

README

          

PSR-HTTP
========

This is a draft based on the work of the psr group on putting together a set of interfaces for http messages.

This work is based on @thewilkybarkid's work and all the posts in the group discussion here:
https://groups.google.com/forum/?fromgroups=#!topic/php-fig/73cM2qq_uho

Some guidelines I try to stick to:

* Interfaces shouldn't contain constructor
* SetBody() should account various data types
* HTTP response code and description must be separated
* Read-only messages skipped because it happens quite often that the have to be modified
* As long as there are no implementation provided, Factories are provided
* Body should be mixed and castable to string
* Request and response should not know about each other
* A response(and a request) should be: serializable, aware of itself only, a value object
* Headers interfaces: can be generic or detailed ones. Interfaces for most common headers are provided but not necessarily used.