title: How to read data from HttpRequest body in asp.net web forms
body: <p>I have created a POST request with some credential information on Request body.</p>
  
  <p>The below request details, I have captured from fiddler.</p>
  
  <p><a href="https://i.stack.imgur.com/MrGDI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MrGDI.png" alt="enter image description here"></a></p>
  
  <p>Raw Data:</p>
  
  <pre><code>POST http://localhost/AutovhcReport/rdPage.aspx?&amp;rdframeid=rdFrame3416d447-50ed-f635-ed09-cdcb201017ee HTTP/1.1
  Host: localhost
  Connection: keep-alive
  Content-Length: 56
  Cache-Control: max-age=0
  Origin: null
  Upgrade-Insecure-Requests: 1
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
  Content-Type: application/x-www-form-urlencoded
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.8
  Cookie: ddllanguage=en-GB; ASP.NET_SessionId=j50rws53zw1wrf4pn0yqmeot; rdPanelExpanded_Table=True; rdTablePanelMenuExpanded=False; rdAllowRedo=False; rdAllowUndo=False
  
  rdReport=SampleReport&amp;rdembedded=true&amp;rdUserName=Dynamic
  </code></pre>
  
  <p>How to read the body values in Asp.net web forms C# ?</p>
  
  <p>I have tried this,
  LoginPage.aspx</p>
  
  <pre><code>&lt;%@ Page Language="c#" %&gt;
  &lt;%@ Import Namespace="System.Net" %&gt;
  &lt;%@ Import Namespace="System.IO" %&gt;
  &lt;%@ Import Namespace="System.Web" %&gt;
  &lt;%@ Import Namespace="System.Configuration" %&gt;
  &lt;%@ Import Namespace="System.Collections.Specialized" %&gt;
  
  &lt;script language="c#" runat="server"&gt;
  
      public void Page_Load(object sender, EventArgs e)
      {
          string username= HttpContext.Current.Request.Form["rdUserName"].ToString();
          Session.Add("rdUserName",username);  
          Session.Add("SiteCode", "7");
          Session.Add("UserName", "xxx");
          Session.Add("Password", "xxxxx");
          HttpContext.Current.Response.Redirect("rdPage.aspx");
  
      }
  &lt;/script&gt;
  </code></pre>