Register a route which takes query parameters and extract those parameters to do the business logic

I am trying to register a route using HTTP.jl which takes a query parameter and extract that query parameter using HTTP.URIs.queryparams but cant’ get it to work. Any help appreciated. Sample code below.
Want to invoke a GET request of the form:

module Resource

using Dates, HTTP, JSON3

using …Model, …Service

const ROUTER = HTTP.Router()

createImage(req) = Service.createImage(

HTTP.@register(ROUTER, “POST”, “/api/image”, createImage)

getImage(req) = Service.getImage(get(HTTP.URIs.queryparams(, “search”, nothing))::Image

HTTP.@register(ROUTER, “GET”, “/api/image”, getImage)

function requestHandler(req)

obj = HTTP.handle(ROUTER, req)

return HTTP.Response(200, JSON3.write(obj))


function run()

HTTP.serve(requestHandler, "", 8080)


end # module