title: POST action - no parameters
body: <p>I have a problem. I want to do a post action and I'm doing it like this:</p>
  
  <pre><code>string post_data = string.Format("taskId={0}&amp;inputId={1}&amp;value={2}", taskId, inputId, "101");
  
  string uri = "http://localhost:60837/Default.aspx";
  // Create a request using a URL that can receive a post. 
          WebRequest request = WebRequest.Create(uri);
          // Set the Method property of the request to POST.
          request.Method = "POST";
          // Create POST data and convert it to a byte array
          var byteArray = Encoding.UTF8.GetBytes(post_data);
          // 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.
          Stream dataStream = request.GetRequestStream();
          // Write the data to the request stream.
          dataStream.Write(byteArray, 0, byteArray.Length);
          // Close the Stream object.
          dataStream.Close();
          // Get the response.
          WebResponse response = request.GetResponse();
          // Display the status.
          Console.WriteLine(((HttpWebResponse)response).StatusDescription);
          // Get the stream containing content returned by the server.
          dataStream = response.GetResponseStream();
          // Open the stream using a StreamReader for easy access.
          StreamReader reader = new StreamReader(dataStream);
          // Read the content.
          string responseFromServer = reader.ReadToEnd ();
          // Display the content.
          Console.WriteLine(responseFromServer);
          // Clean up the streams.
          reader.Close();
          dataStream.Close();
          response.Close();
  </code></pre>
  
  <p>This is my code-behing of my default.aspx:</p>
  
  <pre><code>public partial class _Default : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          Response.Write(Caller.Process(Request.RawUrl, Request.QueryString, Request.UserHostAddress));
      }
  }
  </code></pre>
  
  <p>And my Process method look like this:
      static readonly string
              //paramDefinition = "definition",
              paramTaskId = "taskId",
              paramInputId = "inputId",
              paramValue = "value";</p>
  
  <pre><code>    static public string Process(string query, NameValueCollection collection, string ip)
      {
          StringBuilder result = new StringBuilder();
  
          Func&lt;string, bool&gt; check = str =&gt;
          {
              if (!collection.AllKeys.Contains(str))
              {
                  result.AppendLine(string.Format("No {0} parameter. ", str));
                  return false;
              }
              return true;
          };
          if (check(paramTaskId) &amp;&amp; check(paramInputId) &amp;&amp; check(paramValue))
          {
              result.Append("OK");
              Execute(query, collection, ip);
          }
          else
          {
              WriteLog(result.ToString(), query, ip);
          }
  
          return result.ToString();
      }
  </code></pre>
  
  <p>The problem is I get no parameters on my Deafault.aspx. When I'm doing it in my browser everything is ok. Do you know what can be a problem? Thanks in advance;)</p>