M
M
Multigame2018-09-20 18:25:46
C++ / C#
Multigame, 2018-09-20 18:25:46

How to get request body in ActionFilterAttribute?

Good afternoon.
I'm trying to log incoming requests through Filters in the service.
I ran into a problem that in OnActionExecutingAsync, that in OnActionExecutedAsync I can not get the request body. A string of zero length is returned.
I'm trying to get the body like this
await actionExecutedContext.Request.Content.ReadAsStringAsync()
What am I doing wrong? and how to catch his body in the request?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question