197g / 197g/oxide-auth

How to receive json parameters correctly?

未關閉
#202 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
783
分支
102
PR 合併指標
30 天內沒有已合併 PR

描述

This is the routing method for post_authorize in the example code
```rust
async fn post_authorize(
(r, req, state): (HttpRequest, OAuthRequest, web::Data>), ) -> Result {
) -> Result {
state
.send(Authorize(req).wrap(Extras::AuthPost(r.query_string().to_owned())))
.await?
}
```
The second parameter req is an OAuthRequest object, if I want to receive the json parameter uploaded by the client I have to change the type of this parameter to web::Json, then I lose the OAuthRequest object and can't do the subsequent operations.
How can I receive the json parameter correctly or can I manually create an OAuthRequest object in this method using the OAuthRequest::new() method to perform the subsequent operations.
Thank you!!!

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。