Closed Israel-Laguan closed 1 year ago
Sorry for the delay, I'll get around to this and the other examples this weekend! Thanks for pointing it out -- I can't believe I don't have a json example 🤦♀️ .
Please see #232 for examples!
Can this be closed?
The current doc works with a string body, and the example that would help, the error handle one, don't touch the body.
Filling a form is a basic example for servers, and we can have the most used RESTful CRUD functionality:
DELETE /user/:id
), currently covered for example in:https://github.com/thruster-rs/Thruster/blob/d80cf36ca3f8f40324dc5325a3c150aa5c833953/thruster/examples/mutable_state.rs#L37-L45
(Not sure if there is a "short form"? Maybe like a HashMap
context.params
?)some data from a query param (i.e.
GET /users?limit=12&page=2&query=Tom
), available as the HashMapcontext.query_params
but not shown in examples.data from a body (i.e. in
POST /user
) with a form data like(Note it has inner objects)
I am aware of
context.get_body()
but it is a String and most people just starting to know thruster would expect a way to parse into JSON.I think that including examples that cover such cases, like the JSON body, would help people implement thruster for web servers or other cases.
Request
serde
?