Sau*_*abh 21 java json jersey-client jersey-2.0
我试过这个,
List<String> list = client
.target(url)
.request(MediaType.APPLICATION_JSON)
.get(new GenericType<List<String>>(){});
Run Code Online (Sandbox Code Playgroud)
但我没有得到列表而是获得空值
use*_*685 45
在响应对象中获取响应,然后使用Response方法解析响应对象.
这是一个快速的代码片段:
List<String> list = client
.target(url)
.request(MediaType.APPLICATION_JSON)
.get(Response.class)
.readEntity(new GenericType<List<String>>() {});
/* Do something with the list object */
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
30472 次 |
| 最近记录: |