thruster-rs / Thruster

A fast, middleware based, web framework written in Rust
MIT License
1.06k stars 47 forks source link

feat: Add body_json to homegrown request #189

Closed saiumesh535 closed 3 years ago

saiumesh535 commented 3 years ago

Added body_json function on request to read body as a struct.

previously

context.request.body_as(context.request.body()).unwrap();

can be replaced with following

context.request.body_json().unwrap();