Feature #89216

Provide implementation for PSR-18 HTTP Client

Added by Benjamin Franzke about 1 month ago. Updated 27 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Start date:
2019-09-20
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

PSR-18 [1] HTTP Client is useful in generic middlewares or request handlers, as the PSR-18 interfaces allow to create HTTP requests based on PSR-7 message objects without relying on a specific HTTP client implementation.

Gains for TYPO3 extensions:

While TYPO3 already contains GuzzleHTTP (provided by RequestFactory->request()), PSR-18 allows TYPO3 extensions to include generic PSR-15 middlewares/handlers from external packages (which may already make use of PSR-18 to perform HTTP requests).

The already existing GuzzleHTTP client could be used as (default) backend for the implementation of the PSR-18 ClientInterface.
That means all current HTTP settings would be used as before. No migration required.

[1] https://www.php-fig.org/psr/psr-18/

Associated revisions

Revision ba9ac6f9 (diff)
Added by Benjamin Franzke 27 days ago

[FEATURE] Provide implementation for PSR-18 HTTP Client

The implementation of the PSR-18 ClientInterface is provided
as an adapter to the existing GuzzleHTTP Client. Therefore
existing configuraton settings will be reused.

As our current Guzzle wrapper (RequestFactory->request)
has support for passing custom guzzle per-request options,
we do not deprecate this method but add the PSR-18 implementation
as a more generic alternative.

Once GuzzleHTTP supports PSR-18 natively we can (and will)
drop our adapter and point to Guzzles native implementation
in our dependency injection configuration.
Therefore, this adapter is marked as internal and extensions
are being instructed to depend on the PSR-18 interfaces
only.

composer require psr/http-client:^1.0

Releases: master
Resolves: #89216
Change-Id: I0f2c81916a2f5e4b40abd6f0b146440ef155cf00
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61567
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Benni Mack <>
Reviewed-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61567

#2 Updated by Gerrit Code Review 29 days ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61567

#3 Updated by Gerrit Code Review 27 days ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61567

#4 Updated by Gerrit Code Review 27 days ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61567

#5 Updated by Gerrit Code Review 27 days ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61567

#6 Updated by Benjamin Franzke 27 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF