資源簡介
微信公眾號推廣二維碼源碼 博文連接:https://blog.csdn.net/slx3320612540/article/details/88375918

代碼片段和文件信息
import?okhttp3.*;
import?java.io.File;
import?java.io.IOException;
import?java.util.linkedHashMap;
public?class?HttpUtils?{
????private?static?OkHttpClient?okHttpClient=new?OkHttpClient.Builder().build();
????private?HttpUtils(){
}
????//同步方法
????public?static?String?doGet(String?url){
????????Request?request=new?Request.Builder()
????????????????.get()
????????????????.url(url)
????????????????.build();
????????Call?call=okHttpClient.newCall(request);
????????try?{
????????????Response?response?=?call.execute();
????????????return?response.body().string();
????????}catch(IOException?e){
????????????e.printStackTrace();
????????}
????????return?null;
????}
????public?static?String?doPostJson(String?url?String?jsonMessage){
????????RequestBody?body?=?RequestBody.create(MediaType.parse(“application/json;?charset=utf-8“)jsonMessage);
????????Request?request?=?new?Request.Builder()
????????????????.url(url)
????????????????.post(body)
????????????????.build();
????????Call?call=okHttpClient.newCall(request);
????????try?{
????????????Response?response?=?call.execute();
????????????return?response.body().string();
????????}catch(IOException?e){
????????????e.printStackTrace();
????????}finally?{
????????????call.cancel();
????????}
????????return?null;
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-03-08?10:28??javadoc\
?????文件????????1250??2019-03-08?10:27??javadoc\allclasses-fr
?????文件????????1130??2019-03-08?10:27??javadoc\allclasses-nofr
?????文件????????3680??2019-03-08?10:27??javadoc\constant-values.html
?????文件????????3667??2019-03-08?10:27??javadoc\deprecated-list.html
?????文件????????7791??2019-03-08?10:27??javadoc\help-doc.html
?????文件???????10425??2019-03-08?10:27??javadoc\HttpUtils.html
?????目錄???????????0??2019-03-08?10:19??javadoc\index-files\
?????文件????????5047??2019-03-08?10:27??javadoc\index-files\index-1.html
?????文件????????6191??2019-03-08?10:27??javadoc\index-files\index-10.html
?????文件????????4831??2019-03-08?10:27??javadoc\index-files\index-11.html
?????文件????????5543??2019-03-08?10:27??javadoc\index-files\index-12.html
?????文件????????4970??2019-03-08?09:08??javadoc\index-files\index-13.html
?????文件????????4821??2019-03-08?10:27??javadoc\index-files\index-2.html
?????文件????????9030??2019-03-08?10:27??javadoc\index-files\index-3.html
?????文件????????5015??2019-03-08?10:27??javadoc\index-files\index-4.html
?????文件????????5036??2019-03-08?10:27??javadoc\index-files\index-5.html
?????文件????????5015??2019-03-08?10:27??javadoc\index-files\index-6.html
?????文件????????5199??2019-03-08?10:27??javadoc\index-files\index-7.html
?????文件????????4822??2019-03-08?10:27??javadoc\index-files\index-8.html
?????文件????????5038??2019-03-08?10:27??javadoc\index-files\index-9.html
?????文件????????2843??2019-03-08?10:28??javadoc\index.html
?????文件????????9379??2019-03-08?10:27??javadoc\JsonUtils.html
?????文件????????8496??2019-03-08?10:27??javadoc\Main.html
?????文件????????4576??2019-03-08?10:27??javadoc\overview-tree.html
?????文件????????1355??2019-03-08?10:27??javadoc\package-fr
?????文件???????????2??2019-03-08?10:27??javadoc\package-list
?????文件????????4883??2019-03-08?10:27??javadoc\package-summary.html
?????文件????????4583??2019-03-08?10:27??javadoc\package-tree.html
?????文件???????15002??2019-03-08?10:27??javadoc\QRCodeInfo.html
?????文件?????????857??2019-03-08?10:27??javadoc\sc
............此處省略15個文件信息
- 上一篇:簡單瀏覽器插件,實現網課自動播放
- 下一篇:msp430元件庫封裝
評論
共有 條評論