Read Http Request into Byte array

后端 未结 6 1544
情话喂你
情话喂你 2021-02-05 01:15

I\'m developing a web page that needs to take an HTTP Post Request and read it into a byte array for further processing. I\'m kind of stuck on how to do this, and I\'m stumped

6条回答
  •  囚心锁ツ
    2021-02-05 01:55

    For all those cases when your context.Request.ContentLength is greather than zero, you can simply do:

    byte[] contentBytes = context.Request.BinaryRead(context.Request.ContentLength);
    

提交回复
热议问题