Created
January 7, 2011 16:23
-
-
Save leggetter/769688 to your computer and use it in GitHub Desktop.
How to get the body of a HTTP Request using C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetDocumentContents(System.Web.HttpRequestBase Request) | |
{ | |
string documentContents; | |
using (Stream receiveStream = Request.InputStream) | |
{ | |
using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8)) | |
{ | |
documentContents = readStream.ReadToEnd(); | |
} | |
} | |
return documentContents; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no .InputStream available on my Request :(