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

Allow developer to choose psr http implementation #2652

Open
2 tasks
kaznovac opened this issue Mar 2, 2023 · 3 comments
Open
2 tasks

Allow developer to choose psr http implementation #2652

kaznovac opened this issue Mar 2, 2023 · 3 comments
Labels
feature-request A feature should be added or improved. needs-major-version Can only be considered for the next major release p3 This is a minor priority issue

Comments

@kaznovac
Copy link

kaznovac commented Mar 2, 2023

Describe the feature

currently sdk forces the guzzle as psr7 implementation, it would be benefitial to allow other implementations (like symfony/http-client, ...)

Use Case

I'd like to use the client already in the app without importing and configuring another

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

3.261.2

Environment details (Version of PHP (php -v)? OS name and version, etc.)

N/A

@kaznovac kaznovac added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 2, 2023
@SamRemis
Copy link
Member

SamRemis commented Mar 2, 2023

Hi @kaznovac,
To some extent, this is already possible using the http_handler client configuration option. You can use this to specify your http implementation, but you are bound to having it return a guzzle promise containing a class that implements Psr\Http\Message\ResponseInterface as the response.

With a bit of custom code, this should work for you if you're only looking to have control over the client. If you're looking to decouple from guzzle all together, then this would need a major version bump to change it. Is setting http_handler sufficient for your use case?

@SamRemis SamRemis added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 2, 2023
@kaznovac
Copy link
Author

kaznovac commented Mar 2, 2023

Thank you for the quick answer @SamRamis :)

I'll investigate the suggestion.

In the future, I believe, it would be beneficial to the library to decouple it from the concrete http client.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Mar 3, 2023
@yenfryherrerafeliz yenfryherrerafeliz added the p3 This is a minor priority issue label Mar 13, 2023
@stefangr
Copy link

stefangr commented Apr 2, 2023

It would be great if this package in a future version depends on php-http/discovery instead of guzzlehttp/guzzle and guzzlehttp/psr7. (More on this package on https://docs.php-http.org/en/latest/discovery.html)

This would require updating the minimum PHP version to 7.1, but with a user base of less than 1% of composer users on older PHP versions, that should not be a problem.

@yenfryherrerafeliz yenfryherrerafeliz added the needs-major-version Can only be considered for the next major release label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-major-version Can only be considered for the next major release p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

4 participants