I'm trying to make web requests programmatically in ASP.NET, using the POST method.
I'd like to send POST parameters with the web request as well. Something like this:
WebRequest req = WebRequest.Create("accounts.craigslist.org/login/pstrdr");
req.Method = "POST";
req.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
//WebRequest.Parameters.add("areaabb","hou");
obviously the commented line does not work. How do I achieve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…