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