REST Webサービスで複数のクエリパラメータをPUTする方法を知っていますか? 私はjava.Myカールサンプルを使用して、ライトを持っているが、このようなものです:REST Webサービスで複数のクエリパラメータをPUTする方法
@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");
}
// ...
しかし、私は名前だけのクエリparameter.Howを取得するか、カールを入力する方法を取得する:
curl -X PUT http://localhost:8080/project/resources/user/directory/sub-directory?name=shareuser&type=Read -v
私のプログラムですコマンドを使用してすべてのクエリパラメータを取得しますか?
PUTおよびクエリパラメータ?それはいい感じではありません。 –
それを解決するための提案はありますか?私はウィンドウベースのアプリケーションのためのWebサービスを書いています。私はaldyがWebアプリケーションを持っています。 – sudo
下記の私の答えを参照してください。 –