Skip to content

Accessing request data in guards #3355

Answered by peterschutt
aranvir asked this question in Q&A
Discussion options

You must be logged in to vote

Awaiting receive() is a bit low level and you'd be dealing with asgi messages if you receive anything at all. Also, if the body has already been accessed (perhaps in middleware, or other guards) then why you'd be left hanging on the receive() coroutine.

json() is probably what you want, but if you want the body parsed into a model type then you'd need to use either a dependency or interact with it in the handler.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@aranvir
Comment options

@peterschutt
Comment options

Answer selected by aranvir
@peterschutt
Comment options

@aranvir
Comment options

@aranvir
Comment options

@peterschutt
Comment options

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