okhttp post form表单

 1         OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
 2         FormBody formBody = new FormBody.Builder()
 3                 .add("method","applyLimiteUpdate")
 4                 .build();
 5                 
 6         Request request = new Request.Builder()
 7                 .url("http://1.1.1.1/main.htm")
 8                 .post(formBody)
 9                 .build();
10         
11         Response response = okHttpClient.newCall(request).execute();
12         System.out.println(response.toString());
View Code

 

posted @ 2018-10-08 17:35  xiaodebing  阅读(7861)  评论(0编辑  收藏  举报