470,830 Members | 1,429 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,830 developers. It's quick & easy.

HttpWebResponse return an error: (400) Bad Request

Hello all,
I'm trying to do flagging in the craigslist.org, firstly it works, but when I
used the WebProxy, it gave me this error:
The remote server returned an error: (400) Bad Request

This is my code :

HttpWebRequest myWebRequest = WebRequest.Create("
http://flag.craigslist.org/?flagCode=28&postingID=884589438") as

WebProxy myProxy=new WebProxy();

// Print the Proxy Url to the console.
Console.WriteLine("\nThe actual default Proxy settings are {0}",myProxy.
string proxyAddress;
proxyAddress = "";
if (proxyAddress.Length 0)
// Create a new Uri object.
Uri newUri = new Uri(proxyAddress);
// Associate the newUri object to 'myProxy' object so that new
myProxy settings can be set.
myProxy.Address = newUri;
myWebRequest.Proxy = myProxy;//when i comment this, it works

Console.WriteLine("\nThe Address of the new Proxy settings are {0}",
HttpWebResponse myWebResponse = (HttpWebResponse)myWebRequest.GetResponse
Console.WriteLine(new StreamReader(myWebResponse.GetResponseStream()).
catch(Exception ex)

Anybody can help me?
Thank you!!


Oct 20 '08 #1
1 2830
Is there anybody who can help me?

Message posted via DotNetMonster.com

Oct 21 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Satinderpal Singh | last post: by
reply views Thread by hlabbott | last post: by
1 post views Thread by Satinderpal Singh | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.