Mercurial > hg > Members > nobuyasu > TOModel
comparison test/RequestTest.java @ 4:e12d0b6dbe02 draft default tip
add some files
author | e085711 |
---|---|
date | Wed, 26 Sep 2012 14:43:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:5a097a2336fa | 4:e12d0b6dbe02 |
---|---|
1 import javax.ws.rs.core.MediaType; | |
2 | |
3 import com.sun.jersey.api.client.Client; | |
4 import com.sun.jersey.api.client.ClientResponse; | |
5 import com.sun.jersey.api.client.WebResource; | |
6 | |
7 | |
8 public class RequestTest { | |
9 final static String SERVER_ROOT_URI = "http://localhost:9000/"; | |
10 | |
11 // final static String neo4jEntryPointUri = "http://localhost:7474/db/data/node"; | |
12 | |
13 public static void main(String[] args) { | |
14 final String uri = SERVER_ROOT_URI + "db/data/node"; | |
15 WebResource resource = Client.create().resource(uri); | |
16 ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).post(ClientResponse.class); | |
17 System.out.println(String.format("POST on [%s], status code [%d]", SERVER_ROOT_URI, response.getStatus())); | |
18 System.out.println(response.getEntity(String.class)); | |
19 | |
20 | |
21 | |
22 } | |
23 | |
24 | |
25 } |