Build an URI with query parameters

Using URIs 1.4.2

How to generate URI with query parameters?

URI("http://www.example.com"; query=Dict("a" => "b"))
ERROR: MethodError: no method matching URI(::String; query=Dict("a" => "b"))
Closest candidates are:
    URIs.URI(::String, ::SubString{String}, ::SubString{String}, ::SubString{String}, ::SubString{String}, ::SubString{String}, ::SubString{String}, ::SubString{String}) at ~/.julia/packages/URIs/gpp9J/src/URIs.jl:47 got unsupported keyword argument "query"
    URIs.URI(::AbstractString) at ~/.julia/packages/URIs/gpp9J/src/URIs.jl:146 got unsupported keyword argument "query"
    URIs.URI(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at ~/.julia/packages/URIs/gpp9J/src/URIs.jl:47 got unsupported keyword argument "query"

The first argument needs to be a URI:

hosturi = URI("http://www.example.com")

queryuri = URI(hosturi; query=Dict("a" => "b"))

You don’t have to use a Dict, a vector of pairs works as well:

queryuri = URI(hosturi; query=[:a=>"b"])

You can also set the path:

querywithpath = URI(hosturi; path="/some/endpoint", query=[:a=>"b"])

:scream_cat: that was so close.

Thank you!