0

i want upload to Spring server @RequestBody

json and multipart-file(imgaefile) at ones.

how do i do?

Thanks for help.

최봉재
  • 4,039
  • 3
  • 16
  • 21

1 Answers1

1

I also had the same requirement I have used this code to Put the the image into server

    RequestParams params = new RequestParams();
    try {
        params.put("photo", FragmentPhotoCrop.croppedFile, "image/jpeg");  // croppedFile is a FIle 
        params.setUseJsonStreamer(false);
    } catch (FileNotFoundException e) {
    }

    asyncHttpClient.put(getActivity(), url, params, new AsyncHttpResponseHandler() { ..

       //enter code here

    }

Hope it may help :)

Sanoop Surendran
  • 3,484
  • 4
  • 28
  • 49