Mrtan_1
2020-04-26 18:19
FormBody requestBody = new FormBody.Builder() .add("username",user.getUserName()) .add("password",user.getPassWord()) .build(); Request.Builder builder = new Request.Builder(); final Request request = builder .url(BaseUrl + "login") .post(requestBody) .build(); Call call = okHttpClient.newCall(request); Response response = call.execute(); response.body().contentType(); String res = response.body().string();
设置下编码就好了
Android网络框架-OkHttp使用
23200 学习 · 63 问题
相似问题