@NonNull
    public static Single<Response> postRequest(final String uri, final Parameters params, final Parameters headers,
                                               final String fileFieldName, final String fileContentType, final File file) {
        final MultipartBody.Builder entity = new MultipartBody.Builder().setType(MultipartBody.FORM);
        for (final ImmutablePair<String, String> param : params) {
            entity.addFormDataPart(param.left, param.right);
        }
        entity.addFormDataPart(fileFieldName, file.getName(),
                RequestBody.create(MediaType.parse(fileContentType), file));
        final Builder request = new Request.Builder().url(uri).post(entity.build());
        addHeaders(request, headers, null);
        return RxOkHttpUtils.request(OK_HTTP_CLIENT, request.build());
    }
Multipart POST HTTP request

@param uri             the URI to request
@param params          the parameters to add to the POST request
@param headers         the headers to add to the POST request
@param fileFieldName   the name of the file field name
@param fileContentType the content-type of the file
@param file            the file to include in the request
@return a single with the HTTP response, or an IOException
main/src/main/java/cgeo/geocaching/network/Network.java