Requests icon indicating copy to clipboard operation
Requests copied to clipboard

Add new class to improving handling of URLs

Open jrfnl opened this issue 3 years ago • 0 comments

Both the Curl as well as the Fsockopen class contain a format_get() method which build a URL from parts. These methods are inconsistent and handle the URL building slightly differently.

If I remember correctly, there are also other places in the Requests code where URLs are split/rebuild in various ways.

We should look into creating a class to handle this properly and consistently for all places this kind of functionality is needed in Requests.

That class should make use of the Iri class for splitting URLs and should contain a consistent way to (re)build a URL.

Separating this type of logic out to a separate class will reduce code duplication, reduce technical debt and improve the testability of the logic involved.

jrfnl avatar May 24 '22 11:05 jrfnl