okhttp3已经没有FormEncodingBuilder了,只能用FormBody了,请问用它post键值对时如果有中文需要编码吗?
okhttp3已经没有FormEncodingBuilder了,只能用FormBody了,请问用它post键值对时如果有中文需要编码吗?
okhttp3已经没有FormEncodingBuilder了,只能用FormBody了,请问用它post键值对时如果有中文需要编码吗?
2016-12-19
//2 构造Request
FormBody formbody = new FormBody.Builder().add("username","tangwenjing").add("password","123456").build();//FormBody extends RequestBody
Request.Builder builder = new Request.Builder();
Request request = builder.url(baseUrlString + "login").post(formbody).build();
Call call = okHttpClient.newCall(request);
举报