Skip to content

how to get headers/body/query request parameter at the same time with multiple extractors #320

Answered by davidpdrsn
ggslayer asked this question in Q&A
Discussion options

You must be logged in to vote

You can apply multiple extractors to a function so it’s just a matter of using the right types:

  • Body can be extracted with String, Bytes, or several others in the extract module.
  • You can get cookies with TypedHeader<headers::Cookie>.
  • HeaderMap gives you the headers. Apply this after cookies since it will remove the headers from the request.
  • extract::Query or RawQuery gives you the query.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ggslayer
Comment options

@ggslayer
Comment options

@davidpdrsn
Comment options

Answer selected by davidpdrsn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants