@NonNull
    private static Single<Response> request(final String method, final String uri,
                                            @Nullable final Parameters params, @Nullable final Parameters headers,
                                            @Nullable final File cacheFile) {
        final Builder builder = new Builder();

        if ("GET".equals(method)) {
            final HttpUrl.Builder urlBuilder = HttpUrl.parse(uri).newBuilder();
            if (params != null) {
                urlBuilder.encodedQuery(params.toString());
            }
            builder.url(urlBuilder.build());
        } else {
            builder.url(uri);
            final FormBody.Builder body = new FormBody.Builder();
            if (params != null) {
                for (final ImmutablePair<String, String> param : params) {
                    body.add(param.left, param.right);
                }
            }
            if ("PATCH".equals(method)) {
                builder.patch(body.build());
            } else {
                builder.post(body.build());
            }
        }

        addHeaders(builder, headers, cacheFile);
        final Request request = builder.build();
        if (Log.isDebug()) {
            Log.d("HTTP-" + request.method() + ": " + request.url());
        }
        return RxOkHttpUtils.request(OK_HTTP_CLIENT, builder.build());
    }
Make an HTTP request

@param method    the HTTP method to use ("GET" or "POST")
@param uri       the URI to request
@param params    the parameters to add to the URI
@param headers   the headers to add to the request
@param cacheFile the cache file used to cache this query
@return a single with the HTTP response, or an IOException
main/src/main/java/cgeo/geocaching/network/Network.java