Skip to content

HttpServerRoutes should support query parametersΒ #68

@lucasponce

Description

@lucasponce

Defining a route [1] like

        context = HttpServer.create(8556)
                .newRouter(r -> r
                        .get("/hawkular/alerts", (req, resp) -> {
                            return resp.sendString(Mono.just("Get alerts"));
                        })
                        .route(req -> true, (req, resp) -> {
                            QueryStringDecoder query = new QueryStringDecoder(req.uri());
                            System.out.printf("route: %s %s\n", query.path(), query.parameters());
                            return resp.send();
                        })
                ).block();

get should accept query parameters in some way.

For example, a call like

curl http://localhost:8556/hawkular/alerts?query=AA

should be handled by the "get" route and not the second "route" one, as there is match in the path.

[1] https://github.com/reactor/reactor-netty/blob/master/src/main/java/reactor/ipc/netty/http/server/HttpServerRoutes.java#L174

P.S.: Testing this on 3.0.5.RELEASE version

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions