From 8fac70cc0c4afd1628f83f49b4752ab2b497fc1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=95=BF=E9=BE=99?= Date: Wed, 14 Jun 2017 15:05:13 +0800 Subject: [PATCH] fixed the encode fixed the encode --- .../main/java/org/weiboad/ragnar/logpusher/CurlThread.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logpusher/src/main/java/org/weiboad/ragnar/logpusher/CurlThread.java b/logpusher/src/main/java/org/weiboad/ragnar/logpusher/CurlThread.java index bb72fe2..549983a 100644 --- a/logpusher/src/main/java/org/weiboad/ragnar/logpusher/CurlThread.java +++ b/logpusher/src/main/java/org/weiboad/ragnar/logpusher/CurlThread.java @@ -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)