java调用第三方接口_java调用第三方接口,获取接口返回的数据。

548d111c355d2eae8c95dfa99aa4f155.png

java接收远程调用的数据,得到的是如上个数的返回内容,我怎么写才能获取到值,现在使用的请求方法如下:

public static HttpResult postJsonData(String url, Map params, String charset) throws Exception{

CloseableHttpClient httpclient = HttpClientUtil.createDefault();

HttpPost httpPost = new HttpPost(url);

//拼接参数

List list = new ArrayList();

for (Map.Entry entry : params.entrySet()) {

String key = entry.getKey().toString();

String value = entry.getValue().toString();

System.out.println("key=" \+ key + " value=" \+ value);

NameValuePair pair = new BasicNameValuePair(key, value);

list.add(pair);

}

CloseableHttpResponse response=null

你可能感兴趣的:(java调用第三方接口)