add a way to get a \Psr\Http\Message\UriInterface from a Url object

Created on 27 April 2020, over 4 years ago
Updated 17 October 2024, about 1 month ago

If you have a Url object, and you want to make an HTTP request, you need to get the url as a string before you can pass it to the http_client service.

However, Guzzle also supports \Psr\Http\Message\UriInterface, as I found when I naively tried to pass the Url object:

> InvalidArgumentException: URI must be a string or UriInterface in GuzzleHttp\Psr7\uri_for() (line 62 of /var/www/vendor/guzzlehttp/psr7/src/functions.php).

Could we make Url implement UriInterface? Or add a method to Url to get something that does?

Feature request
Status

Active

Version

11.0 🔥

Component

base system

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024