private void buildMultipartEntity() { entity.addPart(FILE_PART_NAME, new FileBody(mFilePart)); try { entity.addPart(STRING_PART_NAME, new StringBody(mStringPart)); } catch (UnsupportedEncodingException e) { VolleyLog.e("UnsupportedEncodingException"); } }
@Override public byte[] getBody() throws AuthFailureError { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { entity.writeTo(bos); } catch (IOException e) { VolleyLog.e("IOException writing to ByteArrayOutputStream"); } // return bos.toByteArray(); System.out.println("write entity:" + byteArrayGlobal.toString()); return byteArrayGlobal; }
@Override public String getBodyContentType() { System.out.println("entity.getContentType().getValue():" + entity.getContentType().getValue()); return entity.getContentType().getValue(); }