Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
fixed the encode
Browse files Browse the repository at this point in the history
fixed the encode
  • Loading branch information
徐长龙 committed Jun 14, 2017
1 parent 96a5e89 commit 8fac70c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ private String postHttp(String url, String postData) {
builder.retryOnConnectionFailure(false);
OkHttpClient client = builder.build();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded; charset=utf-8");
RequestBody body = RequestBody.create(mediaType, "contents=" + postData);
//MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded; charset=utf-8");
RequestBody body = new FormBody.Builder().add("contents", postData).build();
//RequestBody.create(mediaType, "contents=" + postData);

Request request = new Request.Builder()
.url(url)
Expand Down

0 comments on commit 8fac70c

Please sign in to comment.