cURL / Mailing Lists / curl-users / Single Mail

curl-users

how to get "--data " and "-T" value from curl at the same time in a method

From: zin tun kyaw <jiancai88_at_gmail.com>
Date: Thu, 2 Jun 2011 15:14:51 +0800

hi,
   I have a method to upload a file.
   This the method below.
   "directory" variable and contents are for file "-T" to upload.
   "data" variable is for "--data" for "metadata".

This is my curl command
  curl -T C:\Users\a.jpg --data " { "metadata" : "username":"name"} -H
"Content-Type:application/.." http://localhost:8080/user/folder/a.jpg -v

*But I can't get the "--data" values from data variable.How can i do that?*

  @PUT
    @Path("/{container:.+}")
    @Consumes(MediaTypes.DataObject)
    @Produces(MediaTypes.DataObject)
    public Response doputDataObject(@PathParam("container")String
directory,byte[]contents,String data) throws IOException, Exception
    {
        ...........
        if(bool==true){
           return Response.ok().header("X-CDMI-Specification",
"1.0").build();
        }else{
            return Response.status(Response.Status.BAD_REQUEST).build();
        }

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-06-02