title: Android post request for aspx
body: <p>I am new to android and I have C# code for post request and i want to execute same in android.
   can you guys help me. here is C# code snippet.</p>
  
  <pre><code>WebRequest request = WebRequest.Create("http://domani.url.com");
  
              // Set the Method property of the request to POST.
              request.Method = "POST";
  
              // Create POST data and convert it to a byte array.
              string postData = "©req:1©un:username©pwd:password©flag:MA©ver:1.9.20©";
  
              byte[] byteArray = Encoding.UTF8.GetBytes(postData);
  
              // Set the ContentType property of the WebRequest.
              request.ContentType = "application/x-www-form-urlencoded";
  
              // Set the ContentLength property of the WebRequest.
              request.ContentLength = byteArray.Length;
  
              // Get the request stream.
              using (Stream dataStream = request.GetRequestStream())
              {
                  dataStream.Write(byteArray, 0, byteArray.Length);
              }
  
              // Get the response.
              using (WebResponse response = request.GetResponse())
              using (Stream responseStream = response.GetResponseStream())
              using (StreamReader reader = new StreamReader(responseStream))
              {
                  Console.WriteLine(((HttpWebResponse)response).StatusDescription);
  
                  // Get the stream containing content returned by the server.
                   string responseFromServer = reader.ReadToEnd();
  
                  // Display the content.
                   Response.Write(responseFromServer);
              }
  </code></pre>