A
Arfeen
Hi All,
I need help again .....
I have an asp.net web page which I hit using the "HTTP POST" method.
My ASP.NET page is a basic hello world example with the following code:
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Hello World");
Response.End();
}
Then I use a C# desktop application to HTTP POST some data to this web
site. I use the following code to post data:
System.Net.WebRequest req =
System.Net.WebRequest.Create("http://localhost/proj/page.aspx");
req.Timeout = 20000; //timeout = 20 secnds.
//Add these, as we're doing a POST
req.ContentType = "application/x-www-form-urlencoded";
req.Method = "POST";
//We need to count how many bytes we're sending.
byte [] bytes =
HttpUtility.UrlEncodeToBytes(Parameters,System.Text.ASCIIEncoding.ASCII);//System.Text.Encoding.ASCII.GetBytes(DATA);
req.ContentLength = bytes.Length;
System.IO.Stream os = req.GetRequestStream ();
os.Write (bytes, 0, bytes.Length); //Push it out there
os.Close ();
System.Net.WebResponse resp = req.GetResponse();
My application works perfectly fine on our test servers and a couple of
customer sites , but Im having a problem with one customer, my HTTP
POST messages return the '500 - Internal Server Error'.
And when I browse to the url using internet explorer, I dont get that
error.
So it seems like HTTP GET is working, but HTTP POST does not.
Does anybody have any ideas about what could be wrong here. Is there
some setting that I need to fix in the IIS manager or the security
policies?
Please Help !!!!
I need help again .....
I have an asp.net web page which I hit using the "HTTP POST" method.
My ASP.NET page is a basic hello world example with the following code:
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Hello World");
Response.End();
}
Then I use a C# desktop application to HTTP POST some data to this web
site. I use the following code to post data:
System.Net.WebRequest req =
System.Net.WebRequest.Create("http://localhost/proj/page.aspx");
req.Timeout = 20000; //timeout = 20 secnds.
//Add these, as we're doing a POST
req.ContentType = "application/x-www-form-urlencoded";
req.Method = "POST";
//We need to count how many bytes we're sending.
byte [] bytes =
HttpUtility.UrlEncodeToBytes(Parameters,System.Text.ASCIIEncoding.ASCII);//System.Text.Encoding.ASCII.GetBytes(DATA);
req.ContentLength = bytes.Length;
System.IO.Stream os = req.GetRequestStream ();
os.Write (bytes, 0, bytes.Length); //Push it out there
os.Close ();
System.Net.WebResponse resp = req.GetResponse();
My application works perfectly fine on our test servers and a couple of
customer sites , but Im having a problem with one customer, my HTTP
POST messages return the '500 - Internal Server Error'.
And when I browse to the url using internet explorer, I dont get that
error.
So it seems like HTTP GET is working, but HTTP POST does not.
Does anybody have any ideas about what could be wrong here. Is there
some setting that I need to fix in the IIS manager or the security
policies?
Please Help !!!!