psr7
v0.0.0
Published
Designed to be as close to the PSR7 spec as reasonable. This is to help reduce mental context-switching between languages. Also, I don't know why most JS frameworks treat requests and responses as meager JSON parameter objects.
Downloads
14
Readme
PSR7-Requests In JavaScript
I try to implement PSR7 Request and Response objects as close as reasonable in JavaScript. This is also nice for anyone who thinks about their code in terms of passing around known and well defined objects, plus you gain symetry in how you think about your code between systems.
Modeled after tests in guzzle/psr7
What's ported?
My goal for a v1.0 release is
- Request
- Response
Other aspects of the spec can be added as feature releases. PRs are welcome!
Exceptions from canonical PSR7 spec
While implementing in JavaScript some things may work differently than in PHP.
- Obvious there are no namespaces
- There are no interface guards
- PHP "Array" needs to be swapped for a JS Object any time the keys are named.