Restful note

http://blog.csdn.net/u011970711/article/category/1923271/1

http://www.searchsoa.com.cn/showcontent_75305.htm

dependencies {
    compile files('/home/cmwin/glassfish4/glassfish/modules/javax.ws.rs-api.jar')
    compile files('/home/cmwin/glassfish4/glassfish/modules/javax.batch-api.jar')
    compile files('/home/cmwin/glassfish4/glassfish/modules/jersey-client.jar')
    compile files('/home/cmwin/glassfish4/glassfish/modules/jersey-common.jar')
    compile files('/home/cmwin/glassfish4/glassfish/modules/jersey-container-servlet.jar')
    compile files('/home/cmwin/glassfish4/glassfish/modules/hk2-api.jar')
    compile files('/home/cmwin/glassfish4/glassfish/modules/hk2.jar')
    compile files('/home/cmwin/glassfish4/glassfish/modules/guava.jar')
}

public class ClientTest {    
    public static void main(String[] args) throws IOException {
          Client client = ClientBuilder.newClient();
          WebTarget target = client.target("http://localhost:8080/CssBatch/rest/sample");
          target.request().buildGet().invoke();
          System.out.println("======finished======");
    }
}


你可能感兴趣的:(Restful note)