You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WordPress/Requests is a HTTP request library that is used in WordPress, but is also used as a standalone library. While Requests does not implement PSR-18 itself, they recommend to use WP-Requests-PSR18-Adapter allowing developers to use Requests as a PSR-18 HTTP client.
Full disclosure: I'm the maintainer of the WP-Requests-PSR18-Adapter library.
Example
If a project already have Requests installed, Discovery could auto-install WP-Requests-PSR18-Adapter.
Additional context
At the moment v1.2.0 implements theses interfaces:
Psr-18 ClientInterface
Psr-17 RequestFactoryInterface
These interfaces are partially implemented or planned:
Psr-17 StreamFactoryInterface (partially)
Psr-17 UriFactoryInterface (planned)
If this proposal is accepted I'd be glad to open a PR.
The text was updated successfully, but these errors were encountered:
hi @Art4 thanks for reaching out. looks like a good approach to satisfy wordpress legacy support aims but also provide a modern integration for those who want it.
i discussed that with other maintainers, and we think at the current state, we'd rather not include this wrapper at this time. it is not a complete implementation of PSR-17, and usage numbers are low.
if the client becomes more widely used, please ping us again and we can reconsider.
our recommended pattern is to allow explicitly injecting a client and only fall back to discovery. libraries using that approach will work fine with the wrapper when setting it up manually. even libraries that rely only on discovery can be made to work by providing and registering a custom strategy, see the strategy documentation - the registering needs to be done in the code using your client but you could document how to do it.
Description
WordPress/Requests is a HTTP request library that is used in WordPress, but is also used as a standalone library. While Requests does not implement PSR-18 itself, they recommend to use WP-Requests-PSR18-Adapter allowing developers to use Requests as a PSR-18 HTTP client.
Full disclosure: I'm the maintainer of the WP-Requests-PSR18-Adapter library.
Example
If a project already have Requests installed, Discovery could auto-install WP-Requests-PSR18-Adapter.
Additional context
At the moment v1.2.0 implements theses interfaces:
These interfaces are partially implemented or planned:
If this proposal is accepted I'd be glad to open a PR.
The text was updated successfully, but these errors were encountered: