zoukankan      html  css  js  c++  java
  • jersey客户端返回List的两种方式

    jersey客户端返回List的两种方式:

    前提是服务端的rest实现需要返回list对象

    1) Using array: 

         Client c = ... 
         Token[] ts = c.resource(...).path(...).get(Token[].class); 

    2) Using the the class com.sun.jersey.api.client.GenericType to ensure   
    that 
          generic type information is retained: 

         List<Token>[] ts = c.resource(...).path(...).get(new   
    GenericType<List<Token>>() {});

  • 相关阅读:
    网络编程
    模块
    内置函数
    函数应用
    万能参数
    函数
    爬虫
    算法
    Flask
    linux
  • 原文地址:https://www.cnblogs.com/yoyogis/p/2842695.html
Copyright © 2011-2022 走看看