Mercurial > hg > Members > nobuyasu > TestNeo4j
view src/begin/MakeNode.java @ 5:a3dba713f114 draft
add Neoj4 Library version 1.8.M07
author | one |
---|---|
date | Fri, 17 Aug 2012 19:18:16 +0900 |
parents | 667546c44b36 |
children | 86924c16b4df |
line wrap: on
line source
package begin; import javax.ws.rs.core.MediaType; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; public class MakeNode { final static String nodeEntryPointUri = "http://localhost:7474/db/data/node"; public static void main(String[] args) { /* * make node */ WebResource resource = Client.create().resource(nodeEntryPointUri); ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).entity( "{}"/*Empty Node*/).post(ClientResponse.class); System.out.println(String.format("POST to [%s], status code [%d], location header [%s]",nodeEntryPointUri, response.getStatus(), response.getLocation().toString())); /* * add property */ } }