首页 > 代码库 > Restful note

Restful note

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======");
    }
}