簡便的Java Http請求處理類庫:Http Request

jopen 11年前發布 | 49K 次閱讀 網絡工具包 Http Request

一個簡單方便的使用HttpURLConnection類的庫發出請求和訪問響應。

Perform a GET request and get the status of the response

int response = HttpRequest.get("http://google.com").code(); 

Perform a GET request and get the body of the response

String response = HttpRequest.get("http://google.com").body();  System.out.println("Response was: " + response); 

Print the response of a GET request to standard out

HttpRequest.get("http://google.com").receive(System.out); 

項目主頁:http://www.baiduhome.net/lib/view/home/1371654436187

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!