how to get headers/body/query request parameter at the same time with multiple extractors #320
-
how to get headers/body/query request parameter at the same time with multiple extractors? example request: in my handler, i wan to write like this: my propose is:i want get the four data in the simplist way. please tell me the simplist way, thank you!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can apply multiple extractors to a function so it’s just a matter of using the right types:
|
Beta Was this translation helpful? Give feedback.
You can apply multiple extractors to a function so it’s just a matter of using the right types:
String
,Bytes
, or several others in the extract module.TypedHeader<headers::Cookie>
.HeaderMap
gives you the headers. Apply this after cookies since it will remove the headers from the request.extract::Query
orRawQuery
gives you the query.