title: how to get a responsebody message from android connection
body: <p>I'm using webview to upload the android image file. </p>
  
  <p>Here is my server side(with spring)</p>
  
  <pre><code>@RequestMapping(value = "/mobile/android.do", method = RequestMethod.POST)
  public @ResponseBody String android(
  
          final MultipartHttpServletRequest multiRequest
      ) throws Exception {
  
      LOGGER.info("/mobile/androidFileUpload.do {}","sfsdfsd");
      Map&lt;String, Object&gt; map = new HashMap&lt;&gt;();
      return "sdfdsfsdfds";
  
  }
  </code></pre>
  
  <p>I want to get this responsebody message from the android and returned it.</p>
  
  <p>here is my android side. actually server connection is working. </p>
  
  <pre><code>@JavascriptInterface
      public int uploadFile(final String selectedFilePath){
  
  .......
  
      URL url = new URL(SERVER_URL_FILE+"/mobile/android.do");
                  Log.i(fileName,"File url = "+ url);
                  connection = (HttpURLConnection) url.openConnection();
                  connection.setDoInput(true);//Allow Inputs
                  connection.setDoOutput(true);//Allow Outputs
                  connection.setUseCaches(false);//Don't use a cached Copy
                  connection.setRequestMethod("POST");
                  connection.setRequestProperty("Connection", "Keep-Alive");
                  connection.setRequestProperty("ENCTYPE", "multipart/form-data");
                  connection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary);
                  connection.setRequestProperty("uploaded_file",selectedFilePath);
  //creating new dataoutputstream
                  dataOutputStream = new DataOutputStream(connection.getOutputStream());
  
  
  
                  //writing bytes to data outputstream
                  dataOutputStream.writeBytes(twoHyphens + boundary + lineEnd);
                  dataOutputStream.writeBytes("Content-Disposition: form-data; name=\"uploaded_file\";filename=\"" + selectedFilePath + "\"" + lineEnd);
  
                  dataOutputStream.writeBytes(lineEnd);
  
                  //returns no. of bytes present in fileInputStream
                  bytesAvailable = fileInputStream.available();
                  //selecting the buffer size as minimum of available bytes or 1 MB
                  bufferSize = Math.min(bytesAvailable,maxBufferSize);
                  //setting the buffer as byte array of size of bufferSize
                  buffer = new byte[bufferSize];
  
                  //reads bytes from FileInputStream(from 0th index of buffer to buffersize)
                  bytesRead = fileInputStream.read(buffer,0,bufferSize);
  
                  if(fileInputStream==null)     Log.v(path,"File input null");
                  else       Log.v(path,"File input not null");
                  //loop repeats till bytesRead = -1, i.e., no bytes are left to read
  
                  while (bytesRead &gt; 0){
                      //write the bytes read from inputstream
                      Log.v(path,"read");
                      dataOutputStream.write(buffer,0,bufferSize);
                      bytesAvailable = fileInputStream.available();
                      bufferSize = Math.min(bytesAvailable,maxBufferSize);
                      bytesRead = fileInputStream.read(buffer,0,bufferSize);
                  }
  
                  dataOutputStream.writeBytes(lineEnd);
                  dataOutputStream.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);
  
                  serverResponseCode = connection.getResponseCode();
                  String serverResponseMessage = connection.getResponseMessage();
  
  
                  Log.i(TAG, "Server Response is: " + serverResponseMessage + ": " + serverResponseCode + ":" + connection.getRespon);
  ........
  }
  </code></pre>
  
  <p>the log messsage is as followed.</p>
  
  <p>08-23 14:32:44.681 2040-2607/com.example.ganedu.permission5 I/PermissionDemo: Server Response is: OK: 200</p>
  
  <p>how am i suppose to get a value of responsebody ?</p>