I am attempting to read the Body of a Request from within a View Component, but not having any luck.
When I call GetRawBodyString() I get nothing.
If I use the Body as an Input Stream and use a StreamReader to read it I get nothing.
If I call Seek on the Body it throws an exception "method not supported"
Turns out the issue was that the POST request was using Forms encoded data, which does not appear to be return by the GetRawBody functions. Instead I used the ReadFormAsync method, which returned the correct data.
Reading Body from a ViewComponent
Hi All,
I am attempting to read the Body of a Request from within a View Component, but not having any luck.
When I call GetRawBodyString() I get nothing. If I use the Body as an Input Stream and use a StreamReader to read it I get nothing. If I call Seek on the Body it throws an exception "method not supported"
Does anyone have any ideas please?
Thanks
Kap
Turns out the issue was that the POST request was using Forms encoded data, which does not appear to be return by the GetRawBody functions. Instead I used the ReadFormAsync method, which returned the correct data.
is working on a reply...