0
如何發送請求標頭?假設我想向網站發送HTTP請求時發送自己的請求標頭。如何發送請求標題?
我該怎麼做?
URL url = new URL(urlString);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// HOW DO I SEND REQUEST HEADER LIKE Date,Cookie,Cache-Control ???
http://docs.oracle.com/javase/7/docs/api/java/net/ URLConnection.html#setRequestProperty(java.lang.String,java.lang.String) – tom