amphp / http-client-psr7 Goto Github PK
View Code? Open in Web Editor NEWPSR-7 adapter for amphp/http-client.
License: MIT License
PSR-7 adapter for amphp/http-client.
License: MIT License
As for now, PsrAdapter
class provides full set of methods to convert both Amp and PSR-7 requests and responses in both directions. There is an opinion that it could be split apart.
I think that most frequent use cases will consist of the following (maybe partially):
toPsrRequest()
and fromPsrResponse()
methods):
fromPsrRequest()
and toPsrResponse()
methods):
But, on the other hand, there are cases where "alien" code just alters messages and returns them back (adds headers, for example); in this case, we recieve the same class of object back, like this:
This case requires toPsrRequest()
and fromPsrRequest()
methods, so I decided that splitting the adapter for the first group of cases can harm users that implement second group of cases and vice versa.
I've looked through @trowski 's implementation of server message bridge; it just implements MessageConverter
interface that declares methods convertRequest()
(that works like my toPsrRequest()
) and convertResponse()
(that works like my fromPsrResponse()
). Thus, it allows only first use case.
@kelunik, what do you think about it?
Currently this package is not registered on Packagist so it can't be installed easily (ofc I can still add a vcs repo in my composer.json).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.