Mercurial > hg > Members > nobuyasu > TestNeo4j
view src/begin/MakeNode.java @ 2:667546c44b36 draft
modify MakeNode.java
author | one |
---|---|
date | Fri, 17 Aug 2012 19:12:40 +0900 |
parents | |
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 */ } }