We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It does send the request to my web-server yes, but it does not include any data.
Logging "req.query" yields a result of an empty object, and when logging "req.body" it's undefined.
I've tried both examples, the form data and the json body and none of them work.
For example, this is the example for JSON body
try { http::Request request{ "http://0.0.0.0/get-confirmations" }; const std::string body = "{ \"shared_secret\": \"" + account.shared_secret + "\", \"identity_secret\": \"" + account.identity_secret + "\" }"; const auto response = request.send("POST", body, { {"Content-Type", "application/json"} }); std::cout << std::string{ response.body.begin(), response.body.end() } << '\n'; // print the result } catch (const std::exception& e) { std::cerr << "Request failed, error: " << e.what() << '\n'; }
This is how my web-server is setup atm, just a simple express api
app.post('/get-confirmations', (req, res) => { console.log("query", req.query); console.log("body", req.body); const { shared_secret, identity_secret } = req.query; if (!shared_secret || !identity_secret) { return res.status(400).send('Missing shared_secret or identity_secret'); } return res.send('Hello world | Shared Secret: ' + shared_secret + ' | Identity Secret: ' + identity_secret); });
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
same issue here, didnt find a fix
Sorry, something went wrong.
No branches or pull requests
It does send the request to my web-server yes, but it does not include any data.
Logging "req.query" yields a result of an empty object, and when logging "req.body" it's undefined.
I've tried both examples, the form data and the json body and none of them work.
For example, this is the example for JSON body
This is how my web-server is setup atm, just a simple express api
What am I doing wrong?
The text was updated successfully, but these errors were encountered: