Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kap 21 posts 173 karma points
    Sep 25, 2024 @ 10:48
    Kap
    0

    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

  • Kap 21 posts 173 karma points
    Sep 25, 2024 @ 16:37
    Kap
    100

    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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies