javaweb java如何發(fā)送httphead請求?
java如何發(fā)送httphead請求?實現(xiàn)思想是先定義請求頭的內容,然后設置請求頭。;define request header;LinkedHashMap<string,string> he
java如何發(fā)送httphead請求?
實現(xiàn)思想是先定義請求頭的內容,然后設置請求頭。;define request header;LinkedHashMap<string,string> headers=new LinkedHashMap<string,string>();頁眉.put(“Content type”,“text/xml”)頁眉.put(“Cache Control”、“no Cache”)頁眉.put(“connection”,“close”);為httppost設置請求頭;httppost httppost=new httppost(“address”);如果(標題!=null){;對于(字符串鍵:標題.keySet()) {; httpPost.setHeader文件(鍵標題.get(key));};};備注:只需在映射中設置相應的請求頭內容即可。單擊開始,單擊運行,鍵入regedit,然后單擊確定。
2. 在注冊表中查找并單擊以下項:HKEY CURRENT在“編輯”菜單上,單擊“上方”,指向“新建”,然后單擊“DWORD值”。
4. 鍵入keepalivetimeout并按enter鍵。
5. 在“編輯”菜單上,單擊“修改”。
6. 以毫秒為單位鍵入相應的超時值,然后單擊“確定”。例如,要將超時值設置為2分鐘,請鍵入120000。
7. 重新啟動Internet Explorer。