<table class="java">
<tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 sendByJson uri, propName, jsonStr, defCharset resJson HttpClient httpClient HttpClient 方法的实例,参数传进连接的地址 GetMethod getMethod GetMethoduri HttpMethodParams httpMethodParams HttpMethodParams httpMethodParams.defCharset getMethod.httpMethodParams getMethod.propName jsonStr httpClient.getMethod 方法执行完之后,判断并设置响应charset setResponseCharSetgetMethod,defCharset resJson getMethod. e logger.不支持的编码类型[{0}]",defCharset .不支持的编码类型[{0}]",defCharset HttpException e logger.,e ,e e logger.,e RuntimeIoException,e getMethod. resJson 前端传入json参数时要先编码及替换部分为转义符号: jsonStr .jsonBuilder., e e. jsonStr jsonStr.",.,., retStr sendByJsonuri,paramName,jsonStr,defCharset 方法为上面的get请求 JSONObject.retStr 返回一个JSONObject对象,及服务器返回结果