1

我需要像HttpURLConnectionJava一样的课程。
我可以使用HttpWebRequest,但我需要这样的方法

HttpURLConnection connection = (HttpURLConnection)new URL(requestURL).openConnection();
for (Property p : property)
    connection.addRequestProperty(p.key, p.value); //HttpWebRequest have that?
connection.connect();

有任何想法吗?

4

1 回答 1

4

你想要的WebRequest.Headers财产:

request.Headers["name"] = value;
于 2012-11-10T17:22:17.133 回答