java - Put request using rest -



java - Put request using rest -

i have begun studyin restlet interface. don t know how translate method set using restlet interface.

curl -x set http://ip:port/testdb2

how can translate request? far , have code :

clientresource resource = new clientresource("http://"+this.ip+":5984/"); // send http request representation r=resource.get(); if (resource.getstatus().issuccess()) { resource.getresponseentity().write(system.out); } resource.put(null); if (resource.getstatus().issuccess()){ resource.getresponseentity().write(system.out); } else system.out.println("error put");

how specify new url? need request create couchdb database.

rephrasing question, i'll utilize "how issue set request url ..."

per http://www.restlet.org/documentation/2.0/firstresource#part07

perhaps like

clientresource dbresource = new clientresource( "http://"+this.ip+":5984/testdb2"); representation r = dbresource.put(null);

java rest restlet

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -