-
Notifications
You must be signed in to change notification settings - Fork 37
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
POST Example #2
Comments
pub fn body(&self) -> &[u8] { |
I submitted a pull request to add the implementation of the body() api #3 |
Thanks!! |
StratusFearMe21
added a commit
to StratusFearMe21/may_minihttp
that referenced
this issue
Nov 22, 2022
Xudong-Huang
added a commit
that referenced
this issue
Feb 18, 2024
Xudong-Huang
added a commit
that referenced
this issue
Feb 18, 2024
Xudong-Huang
added a commit
that referenced
this issue
Feb 19, 2024
I think we can close this now. the request has a body() API which impl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am trying to do a simple POST. I tried this,
match (req.method(), req.path()) { ("GET", "/json") => { rsp.header("Content-Type: application/json"); serde_json::to_writer( BodyWriter(rsp.body_mut()), &HelloMessage { message: "Hello, World!", }, )?; }, ("POST", "/json") => { rsp.header("Content-Type: application/json"); serde_json::to_writer( BodyWriter(rsp.body_mut()), req.data(), )?; }, ("GET", "/plaintext") => { rsp.header("Content-Type: text/plain").body("Hello, World!"); }, _ => { rsp.status_code("404", "Not Found"); }, }
However, I am not able to access the request Body. Do you have any suggestions perhaps ?
Kind regards
Savi
The text was updated successfully, but these errors were encountered: