docs: remove note about string body

main
Carsten Kragelund 2023-08-02 19:51:51 +02:00
parent e0292cca6a
commit ad92655eab
Signed by: nyx
GPG Key ID: CADDADEEC9F753C0
1 changed files with 0 additions and 11 deletions

@ -17,14 +17,3 @@ Though that might just be my Rust brain, and this is more common with JS tools
* =rapid run= seems to recompile too often
Even when changing a non-backend file, rapid run will rebuild the entire backend/regenerate the types. This is not really a problem as its extremely fast, but it does mean the console updates with the build information even for non-backend changes.
This includes documentation files too like this =NOTES.org= or the =README.md=
* Body in POST request handlers
Unsure how to properly handle the incoming data on the Rust side. Used the following snippets to accept any arbitrary bytes and then convert them to a string.
#+BEGIN_SRC rust
#[rapid_handler]
pub async fn post(bytes: Bytes) -> HttpResponse {
let body = String::from_utf8(bytes.to_vec()).unwrap();
// ...
}
#+END_SRC
This is obviously not ideal, since the actual request handler has to manage errors arising from non-utf8 data or if there has to be structured data such as JSON.