Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSR-7 #266

Closed
enumag opened this issue Apr 28, 2020 · 8 comments
Closed

PSR-7 #266

enumag opened this issue Apr 28, 2020 · 8 comments

Comments

@enumag
Copy link
Contributor

enumag commented Apr 28, 2020

Do you have / know about any existing implementation that would allow me to transform a PSR-7 request into Amp\Http\Client\Request and later a Amp\Http\Client\Response into a PSR-7 response?

@kelunik
Copy link
Member

kelunik commented Apr 28, 2020

I don't know about anything like that, but we could probably easily add it.

@nicolas-grekas
Copy link
Contributor

nicolas-grekas commented Apr 28, 2020

https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpClient/Psr18Client.php

This will do the job and allows mapping this to that.
Note that PSR-7 is mostly not compatible with any async feature so there is little better you can do than use PSR-18.

@remorhaz
Copy link
Contributor

remorhaz commented May 7, 2020

That would be a nice feature, sometimes there's a need to pass messages to PSR-compatible code or receive it from there, and I have to implement adapters by myself. It's an easy task, but it's better to have it done by library.

@kelunik
Copy link
Member

kelunik commented May 7, 2020

@remorhaz If you already have the code, a PR is welcome. ;-)

@remorhaz
Copy link
Contributor

I guess it's better to implement it as a part of amphp/http (consider moving the issue). I will prepare the PR soon.

@remorhaz
Copy link
Contributor

Oops, seems that Message class is too abstract, it doens't even contain a body. In this case let's move from particulars to generals.

@kelunik
Copy link
Member

kelunik commented May 11, 2020

Yes, it needs to be implemented here instead.

@kelunik
Copy link
Member

kelunik commented Jun 16, 2020

@kelunik kelunik closed this as completed Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants