I am trying to upload an image from camera or gallery using retrofit2 It runs perfect until enqueue() method but after that it returns a 400 bad requeat with this response: like this: D/OkHttp: ������JFIF����������������C�� ....
Api call:
  @Multipart
@POST("feed/")
Call<ResponseBody> postFeedItem(@Part("location") RequestBody location,
                                @Part MultipartBody.Part m_Url);
Upload method in Fragment:
 private void sharePost(){
    File file = new File(globalPost);
    RequestBody filePart = RequestBody.create(MediaType.parse("image/*"),file);
    MultipartBody.Part body = MultipartBody.Part.createFormData("m_Url",file.getName(),filePart);
    Timber.i(file.toString());
    String loc = location.getText().toString();
    RequestBody loc_req = RequestBody.create(MultipartBody.FORM,loc);
    if(loc !=null && file != null){
        Call<ResponseBody> call = ApiClient.getApiClient().create(UserClient.class).postFeedItem(loc_req,body);
        call.enqueue(new Callback<ResponseBody>() {
            @Override
            public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
                Toast.makeText(getContext(),response.code(),Toast.LENGTH_LONG).show();
                Timber.i(String.valueOf(response.code()));
            }
            @Override
            public void onFailure(Call<ResponseBody> call, Throwable t) {
                Timber.e(t.getMessage()+"onFailure()");
            }
        });
    }
}
Result from gallery or camera:
   @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == Activity.RESULT_OK) {
        if (requestCode == REQUEST_CAMERA) {
            //Bundle bundle = data.getExtras();
          //  final Bitmap bmp = (Bitmap) data.getExtras().get("data");
            //imageView.setImageBitmap(bmp);
            Glide.with(this).load(imageFilePath).into(imageView);
            //imageBitmap = bmp;
            globalPost = imageFilePath;
            share.setVisibility(View.VISIBLE);
        } else if (requestCode == REQUEST_GALLERY) {
            Uri selectedImageUri = data.getData();
            imageView.setImageURI(selectedImageUri);
            try {
                String[] filePathColumn = { MediaStore.Images.Media.DATA };
                Cursor cursor = getActivity().getContentResolver().query(selectedImageUri,
                        filePathColumn, null, null, null);
                cursor.moveToFirst();
                int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
                String picturePath = cursor.getString(columnIndex);
                globalPost = picturePath;
                cursor.close();
                share.setVisibility(View.VISIBLE);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
private String imageToString(Bitmap imageBitmap) {
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    imageBitmap.compress(Bitmap.CompressFormat.JPEG,100,byteArrayOutputStream);
    byte[] imgByte = byteArrayOutputStream.toByteArray();
    return Base64.encodeToString(imgByte,Base64.DEFAULT);
}

