Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Unable to send query parameters #71

Open
rehovicova opened this issue Jul 10, 2020 · 1 comment
Open

Unable to send query parameters #71

rehovicova opened this issue Jul 10, 2020 · 1 comment

Comments

@rehovicova
Copy link

rehovicova commented Jul 10, 2020

Hi, I am not able to send query parameters. I tried this:

mux.handle("api/moveby/{x}")
	.post([](served::response & res, const served::request & req) {
            std::string x = req.params["x"]; // gets x from path
            std::string y = req.query["y"]; // gets nothing
        }

I am using curl:
curl -d y=2 localhost:8080/api/moveby/1

No matter what I do I can't retrieve it. And I don't really want to use path params.

@dominique120
Copy link

dominique120 commented Sep 26, 2020

I have the same issue. I am unable to get any data when sending parameters with a post request. I've tried sending it as form-data, form-urlencoded, json, etc but nothing seems to work. The examples are not very clear on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants