Closed
Description
Symfony version(s) affected
5,4, 6.4
Description
for example if some API i want to connect uses HTTP Status Codes like this:
HTTP/1.1 404 countryCodeNotFound
then when using Symfony HttpClient as its own Client, then the Exception sets the Message correct
but the Psr18Client doesn't parse the response_headers
like the Exceptions do
https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/HttpClient/Exception/HttpExceptionTrait.php#L34
the Psr18Client sets the status code without trying to set the message too:
https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/HttpClient/Psr18Client.php#L108
How to reproduce
have an API with custom status messages:
HTTP/1.1 404 countryCodeNotFound
Possible Solution
Similar code that is done in the Exception Trait should also be done in the Psr18Client
Additional Context
No response