M
Mange
I'm using WebRequest class to access a PHP script, but keep getting a
400 error from the server when calling the GetResponse() method.
I have added the url to the script in the bypass list in machine.config
to bypass the proxy server for this request, so it should not be a
proxy issue. Also, I tried to run the same code in a Windows app, to
see if it had to do with user credentials but no luck there.
The script can be accessed with IE without any problem, so there is a
way to get to the script, I just can't get ASP.Net to do it...
This is the code:
HttpWebRequest StockRequest =
(HttpWebRequest)WebRequest.Create("http://urltomyscript/scriptname.php");
StockRequest.Timeout = 10000; //10 seconds
HttpWebResponse StockResponse =
(HttpWebResponse)StockRequest.GetResponse();
Regards,
Mange
400 error from the server when calling the GetResponse() method.
I have added the url to the script in the bypass list in machine.config
to bypass the proxy server for this request, so it should not be a
proxy issue. Also, I tried to run the same code in a Windows app, to
see if it had to do with user credentials but no luck there.
The script can be accessed with IE without any problem, so there is a
way to get to the script, I just can't get ASP.Net to do it...
This is the code:
HttpWebRequest StockRequest =
(HttpWebRequest)WebRequest.Create("http://urltomyscript/scriptname.php");
StockRequest.Timeout = 10000; //10 seconds
HttpWebResponse StockResponse =
(HttpWebResponse)StockRequest.GetResponse();
Regards,
Mange