public void Request(final String Strjson) throws IOException {
new Thread(new Runnable() {
@Override
public void run() {
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, Strjson);
Log.i("Json",Strjson);
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
Response response = null;
try {
response = client.newCall(request).execute();
//String result = response.body().string();
} catch (IOException e) {
}
}
}).start();
}
服务端得不到请求的值,也没有报错