URIs.jl icon indicating copy to clipboard operation
URIs.jl copied to clipboard

Building URI with keyword arguments returns empty `.uri` field ("")

Open SteadyGiant opened this issue 4 years ago • 0 comments

Julia 1.4.2 HTTP.jl 0.8.16 MbedTLS.jl 1.0.2

When I pass scheme, host, and query arguments to HTTP.URI(), the returned object has no .uri field; rather, .uri equals "", an empty string. When I pass a string URL to HTTP.URI(), the returned object has a non-empty .uri field.

HTTP.URI(str) works as expected:

HTTP.URI("https://example.com").uri
# "https://example.com"

HTTP.URI(; scheme="", host="", port="", etc...) does not:

HTTP.URI(scheme="https", host="example.com").uri
# ""

Is this intended?

I'm fine doing the following to get what I want, but the above behavior just wasn't what I was expecting.

HTTP.URI(scheme="https", host="example.com") |> string
# "https://example.com"

SteadyGiant avatar Jul 17 '20 02:07 SteadyGiant