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

Add Psr18Client to make it straightforward to use PSR-18 #230

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

nicolas-grekas
Copy link
Collaborator

@nicolas-grekas nicolas-grekas commented Apr 26, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets -
Documentation -
License MIT

Psr18Client extends Psr17Client so that this dramatically cuts the boilerplate to make an HTTP request:

use Http\Discovery\Psr18Client;

$client = new Psr18Client();
$request = $client->createRequest('GET', 'https://example.com/');
$response = $client->sendRequest($request);

Internally, this code reuses whatever PSR-7, PSR-17 and PSR-18 implementations are installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant