http://xiangai.taobao.com
http://shop148612228.taobao.com

OkHttp3找不到FormEncodingBuilder

okhttp3.FormBody instead of FormEncodingBuilder.(OkHttp3.x,FormEncodingBuilder已被FormBody取代)

 

OkHttpClient client = new OkHttpClient();
FormBody body = new FormBody.Builder()
     .add("your_param_1", "your_value_1")
     .add("your_param_2", "your_value_2")
     .build();
Request request = new Request.Builder()
     .url("http://my.wonderfull.url/to/post")
     .post(body)
     .build();
Response response = client.newCall(request).execute();

 

https://github.com/square/okhttp,OkHttp3.x与2.x不同之处见CHANGELOG.md
————————————————
版权声明:本文为CSDN博主「xw1_xw」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/xw1_xw/article/details/50724864

posted @ 2020-07-27 11:11  万事俱备就差个程序员  阅读(606)  评论(0编辑  收藏  举报

http://xiangai.taobao.com
http://shop148612228.taobao.com
如果您觉得对您有帮助.领个红包吧.谢谢.
支付宝红包
微信打赏 支付宝打赏