Accessing body/payload within HttpRequest #2235
Unanswered
GetSource1234
asked this question in
Q&A
Replies: 1 comment 5 replies
-
This will be easier in v4, for now into_parts is the only way to do this. HttpRequest is designed to not allow payload access. |
Beta Was this translation helpful? Give feedback.
5 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.
-
Hi!
I have a question. I am trying to implement middleware that do some checks within HttpRequest. Currently, I see only one option is to get payload within ServiceRequest:
pub fn into_parts(self) -> (HttpRequest, Payload)
But it is not really handy, since I need to do some check within ServiceResponse. I am wondering is there any approche to get HttpRequest body/payload within ServiceResponse. Also, wondering why such methods are not implemented in HttpRequest, something like:
P.S.
I see pretty match the same issue, But it is closed, without any handy solution.
Beta Was this translation helpful? Give feedback.
All reactions