HTTP.jl
HTTP.jl copied to clipboard
`url` field of the request is not set on the service side
MWE:
using HTTP
function handle(req)
HTTP.Response(200, string(req.url))
end
router = HTTP.Router()
HTTP.register!(router, "/", handle)
server = HTTP.serve!(router, "127.0.0.1", 8122)
HTTP.get("http://127.0.0.1:8122") # empty result
Hi Jun, I also stumbled upon this, concretely in Pluto - when adding query params to the url, they don't appear in the url but in the req.target field. I guess it is related to your MWE.
At least this means the documentation is wrong, it states url::URI, the full URI of the request, or it is a bug.
This looks crucial - @quinnj can you take a look?
https://github.com/JuliaWeb/HTTP.jl/blob/5cd586d8fba2b4208b028aed832104443c1abd07/src/Handlers.jl#L391
Indeed, it's also used in the source code.
dup of https://github.com/JuliaWeb/HTTP.jl/issues/1041 ?