Skip to content

Accessing a form in middleware #1475

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

You must be logged in to vote

Its possible but hard since the middleware would have to consume the request body and insert it back before calling the handler.

Instead I'd recommend writing your own extractor that internally calls Form and does whatever processing needed there. Then you can use that extractor in your handlers instead.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@yatesco
Comment options

@jplatte
Comment options

Answer selected by yatesco
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants