REST Web サービスで複数のクエリ パラメータを PUT する方法を知っている人はいますか? 私はJavaを使用して書いています。私のcurlサンプルは次のようなものです:
curl -X PUT http://localhost:8080/project/resources/user/directory/sub-directory?name=shareuser&type=Read -v
私のプログラムは:
@PUT
@Path("{user}/{directory:.+}")
public Response doshare(@PathParam("user")String name,
@PathParam("directory")String dir,
@QueryParam("name")String sharename,
@QueryParam("type")String type){
mongoDAOImpl impl=new mongoDAOImpl();
Mongo mongo=impl.getConnection("127.0.0.1","27017");
DB db=impl.getDataBase(mongo,"public");
DBCollection coll=impl.getColl(db,name);
DBCollection coll2=impl.getColl(db,"sharedb");
shareDTO sharedto=new shareDTO();
String authority=type.toLowerCase();
if(authority.equals("rd")){
sharedto.setAuthority("4");
}else if(authority.equals("rw")){
sharedto.setAuthority("12");
}
sharedto.setTargetuser(sharename);
sharedto.setRealURI("/home/public/"+name+"/"+dir);
sharedto.setIdentifier(name);
sharedto.setParentURI("/home/public/"+sharename);
boolean bool = false;
sharefun=new sharefunction();
if(sharefun.checksubfoldershared(coll, coll2, sharedto)){
bool=sharefun.sharefiles(coll, coll2, sharedto);
}else{
System.out.println("Error");
}
// ...
しかし、名前のクエリ パラメータしか取得できません。すべてのクエリ パラメータを取得するために、curl コマンドを取得または入力する方法を教えてください。