怎么直接提取请求头的参数? #1092
Unanswered
Xiaobaishushu25
asked this question in
Q&A
怎么直接提取请求头的参数?
#1092
Replies: 3 comments 1 reply
-
https://docs.rs/salvo_core/latest/salvo_core/http/request/struct.Request.html#method.header |
Beta Was this translation helpful? Give feedback.
1 reply
-
https://docs.rs/salvo-oapi/0.77.1/salvo_oapi/extract/struct.HeaderParam.html |
Beta Was this translation helpful? Give feedback.
0 replies
-
如果你从多个地方比如header, querystring 等解析参数,还可以直接解析为一个结构体。 https://github.com/salvo-rs/salvo/blob/main/examples/extract-nested/src/main.rs |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
文档示例是:
这种只能指定数字或者字符串之类的类型的吗,如果我想要获取请求头里面的
authorization
,有什么类似springboot中的:这种直接获取某个字段的值的方法吗,我目前只能手动提取:
Beta Was this translation helpful? Give feedback.
All reactions