Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpServerRoutes should support query parameters #68

Open
lucasponce opened this issue Apr 6, 2017 · 7 comments
Open

HttpServerRoutes should support query parameters #68

lucasponce opened this issue Apr 6, 2017 · 7 comments
Labels
help wanted We need contributions on this type/enhancement A general enhancement
Milestone

Comments

@lucasponce
Copy link

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

@smaldini smaldini modified the milestone: 0.6.3.RELEASE Apr 7, 2017
@smaldini smaldini added the type/enhancement A general enhancement label May 3, 2017
@smaldini smaldini modified the milestones: 0.6.3.RELEASE, 0.7.0.RELEASE May 3, 2017
@smaldini smaldini modified the milestones: 0.7.0.RELEASE, 0.8.0.RELEASE Sep 14, 2017
@smaldini smaldini modified the milestones: 0.8.0.RELEASE, 0.9.0.RELEASE Oct 24, 2017
@violetagg violetagg modified the milestones: 0.9.0.RELEASE, 0.9.x Backlog Jun 8, 2018
@violetagg violetagg modified the milestones: 0.9.x Maintenance Backlog, 1.0.0 Backlog Jan 10, 2020
@odravison
Copy link

This feature was implemented?

@violetagg
Copy link
Member

@odravison No it is not. Are you interested in providing a PR?

@violetagg violetagg added the help wanted We need contributions on this label Nov 11, 2020
@odravison
Copy link

Maybe I do this soon. Just let me get a free time to do so.

Do you know if this feature (query parameters) was implemented on HttpClient module?

@violetagg
Copy link
Member

@odravison There is similar feature request for query params on the client #753

@violetagg
Copy link
Member

@odravison Also can you clarify the use case? Is it for routing? If yes can't you use the current API for custom predicates for routing?

@violetagg
Copy link
Member

Note: When implementing this feature, we need to discuss also non URL-encode query parameters - #1561

@coditori
Copy link

From 2017 to 2022 and still nothing :|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We need contributions on this type/enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants