@Test public void appendWithVarargsQueryParamsWithExistingParams() { assertEquals("http: HttpRequest.append("http: assertEquals("http: HttpRequest.append("http: }
public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); while (iterator.hasNext()) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); } return result.toString(); }
HttpRequest { public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); while (iterator.hasNext()) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); } return result.toString(); } }
HttpRequest { public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); while (iterator.hasNext()) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); } return result.toString(); } HttpRequest(final CharSequence url, final String method);  HttpRequest(final URL url, final String method); }
HttpRequest { public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); while (iterator.hasNext()) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); } return result.toString(); } HttpRequest(final CharSequence url, final String method);  HttpRequest(final URL url, final String method); static void setConnectionFactory(final ConnectionFactory connectionFactory); static String encode(final CharSequence url); static String append(final CharSequence url, final Map<?, ?> params); static String append(final CharSequence url, final Object... params); static HttpRequest get(final CharSequence url); static HttpRequest get(final URL url); static HttpRequest get(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest get(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest post(final CharSequence url); static HttpRequest post(final URL url); static HttpRequest post(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest post(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest put(final CharSequence url); static HttpRequest put(final URL url); static HttpRequest put(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest put(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest delete(final CharSequence url); static HttpRequest delete(final URL url); static HttpRequest delete(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest delete(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest head(final CharSequence url); static HttpRequest head(final URL url); static HttpRequest head(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest head(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest options(final CharSequence url); static HttpRequest options(final URL url); static HttpRequest trace(final CharSequence url); static HttpRequest trace(final URL url); static void keepAlive(final boolean keepAlive); static void maxConnections(final int maxConnections); static void proxyHost(final String host); static void proxyPort(final int port); static void nonProxyHosts(final String... hosts); @Override String toString(); HttpURLConnection getConnection(); HttpRequest ignoreCloseExceptions(final boolean ignore); boolean ignoreCloseExceptions(); int code(); HttpRequest code(final AtomicInteger output); boolean ok(); boolean created(); boolean noContent(); boolean serverError(); boolean badRequest(); boolean notFound(); boolean notModified(); String message(); HttpRequest disconnect(); HttpRequest chunk(final int size); HttpRequest bufferSize(final int size); int bufferSize(); HttpRequest uncompress(final boolean uncompress); String body(final String charset); String body(); HttpRequest body(final AtomicReference<String> output); HttpRequest body(final AtomicReference<String> output, final String charset); boolean isBodyEmpty(); byte[] bytes(); BufferedInputStream buffer(); InputStream stream(); InputStreamReader reader(final String charset); InputStreamReader reader(); BufferedReader bufferedReader(final String charset); BufferedReader bufferedReader(); HttpRequest receive(final File file); HttpRequest receive(final OutputStream output); HttpRequest receive(final PrintStream output); HttpRequest receive(final Appendable appendable); HttpRequest receive(final Writer writer); HttpRequest readTimeout(final int timeout); HttpRequest connectTimeout(final int timeout); HttpRequest header(final String name, final String value); HttpRequest header(final String name, final Number value); HttpRequest headers(final Map<String, String> headers); HttpRequest header(final Entry<String, String> header); String header(final String name); Map<String, List<String>> headers(); long dateHeader(final String name); long dateHeader(final String name, final long defaultValue); int intHeader(final String name); int intHeader(final String name, final int defaultValue); String[] headers(final String name); String parameter(final String headerName, final String paramName); Map<String, String> parameters(final String headerName); String charset(); HttpRequest userAgent(final String userAgent); HttpRequest referer(final String referer); HttpRequest useCaches(final boolean useCaches); HttpRequest acceptEncoding(final String acceptEncoding); HttpRequest acceptGzipEncoding(); HttpRequest acceptCharset(final String acceptCharset); String contentEncoding(); String server(); long date(); String cacheControl(); String eTag(); long expires(); long lastModified(); String location(); HttpRequest authorization(final String authorization); HttpRequest proxyAuthorization(final String proxyAuthorization); HttpRequest basic(final String name, final String password); HttpRequest proxyBasic(final String name, final String password); HttpRequest ifModifiedSince(final long ifModifiedSince); HttpRequest ifNoneMatch(final String ifNoneMatch); HttpRequest contentType(final String contentType); HttpRequest contentType(final String contentType, final String charset); String contentType(); int contentLength(); HttpRequest contentLength(final String contentLength); HttpRequest contentLength(final int contentLength); HttpRequest accept(final String accept); HttpRequest acceptJson(); HttpRequest progress(final UploadProgress callback); HttpRequest part(final String name, final String part); HttpRequest part(final String name, final String filename,
      final String part); HttpRequest part(final String name, final String filename,
      final String contentType, final String part); HttpRequest part(final String name, final Number part); HttpRequest part(final String name, final String filename,
      final Number part); HttpRequest part(final String name, final File part); HttpRequest part(final String name, final String filename,
      final File part); HttpRequest part(final String name, final String filename,
      final String contentType, final File part); HttpRequest part(final String name, final InputStream part); HttpRequest part(final String name, final String filename,
      final String contentType, final InputStream part); HttpRequest partHeader(final String name, final String value); HttpRequest send(final File input); HttpRequest send(final byte[] input); HttpRequest send(final InputStream input); HttpRequest send(final Reader input); HttpRequest send(final CharSequence value); OutputStreamWriter writer(); HttpRequest form(final Map<?, ?> values); HttpRequest form(final Entry<?, ?> entry); HttpRequest form(final Entry<?, ?> entry, final String charset); HttpRequest form(final Object name, final Object value); HttpRequest form(final Object name, final Object value, String charset); HttpRequest form(final Map<?, ?> values, final String charset); HttpRequest trustAllCerts(); HttpRequest trustAllHosts(); URL url(); String method(); HttpRequest useProxy(final String proxyHost, final int proxyPort); HttpRequest followRedirects(final boolean followRedirects); }
HttpRequest { public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); while (iterator.hasNext()) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); addParam(entry.getKey().toString(), entry.getValue(), result); } return result.toString(); } HttpRequest(final CharSequence url, final String method);  HttpRequest(final URL url, final String method); static void setConnectionFactory(final ConnectionFactory connectionFactory); static String encode(final CharSequence url); static String append(final CharSequence url, final Map<?, ?> params); static String append(final CharSequence url, final Object... params); static HttpRequest get(final CharSequence url); static HttpRequest get(final URL url); static HttpRequest get(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest get(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest post(final CharSequence url); static HttpRequest post(final URL url); static HttpRequest post(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest post(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest put(final CharSequence url); static HttpRequest put(final URL url); static HttpRequest put(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest put(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest delete(final CharSequence url); static HttpRequest delete(final URL url); static HttpRequest delete(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest delete(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest head(final CharSequence url); static HttpRequest head(final URL url); static HttpRequest head(final CharSequence baseUrl,
      final Map<?, ?> params, final boolean encode); static HttpRequest head(final CharSequence baseUrl,
      final boolean encode, final Object... params); static HttpRequest options(final CharSequence url); static HttpRequest options(final URL url); static HttpRequest trace(final CharSequence url); static HttpRequest trace(final URL url); static void keepAlive(final boolean keepAlive); static void maxConnections(final int maxConnections); static void proxyHost(final String host); static void proxyPort(final int port); static void nonProxyHosts(final String... hosts); @Override String toString(); HttpURLConnection getConnection(); HttpRequest ignoreCloseExceptions(final boolean ignore); boolean ignoreCloseExceptions(); int code(); HttpRequest code(final AtomicInteger output); boolean ok(); boolean created(); boolean noContent(); boolean serverError(); boolean badRequest(); boolean notFound(); boolean notModified(); String message(); HttpRequest disconnect(); HttpRequest chunk(final int size); HttpRequest bufferSize(final int size); int bufferSize(); HttpRequest uncompress(final boolean uncompress); String body(final String charset); String body(); HttpRequest body(final AtomicReference<String> output); HttpRequest body(final AtomicReference<String> output, final String charset); boolean isBodyEmpty(); byte[] bytes(); BufferedInputStream buffer(); InputStream stream(); InputStreamReader reader(final String charset); InputStreamReader reader(); BufferedReader bufferedReader(final String charset); BufferedReader bufferedReader(); HttpRequest receive(final File file); HttpRequest receive(final OutputStream output); HttpRequest receive(final PrintStream output); HttpRequest receive(final Appendable appendable); HttpRequest receive(final Writer writer); HttpRequest readTimeout(final int timeout); HttpRequest connectTimeout(final int timeout); HttpRequest header(final String name, final String value); HttpRequest header(final String name, final Number value); HttpRequest headers(final Map<String, String> headers); HttpRequest header(final Entry<String, String> header); String header(final String name); Map<String, List<String>> headers(); long dateHeader(final String name); long dateHeader(final String name, final long defaultValue); int intHeader(final String name); int intHeader(final String name, final int defaultValue); String[] headers(final String name); String parameter(final String headerName, final String paramName); Map<String, String> parameters(final String headerName); String charset(); HttpRequest userAgent(final String userAgent); HttpRequest referer(final String referer); HttpRequest useCaches(final boolean useCaches); HttpRequest acceptEncoding(final String acceptEncoding); HttpRequest acceptGzipEncoding(); HttpRequest acceptCharset(final String acceptCharset); String contentEncoding(); String server(); long date(); String cacheControl(); String eTag(); long expires(); long lastModified(); String location(); HttpRequest authorization(final String authorization); HttpRequest proxyAuthorization(final String proxyAuthorization); HttpRequest basic(final String name, final String password); HttpRequest proxyBasic(final String name, final String password); HttpRequest ifModifiedSince(final long ifModifiedSince); HttpRequest ifNoneMatch(final String ifNoneMatch); HttpRequest contentType(final String contentType); HttpRequest contentType(final String contentType, final String charset); String contentType(); int contentLength(); HttpRequest contentLength(final String contentLength); HttpRequest contentLength(final int contentLength); HttpRequest accept(final String accept); HttpRequest acceptJson(); HttpRequest progress(final UploadProgress callback); HttpRequest part(final String name, final String part); HttpRequest part(final String name, final String filename,
      final String part); HttpRequest part(final String name, final String filename,
      final String contentType, final String part); HttpRequest part(final String name, final Number part); HttpRequest part(final String name, final String filename,
      final Number part); HttpRequest part(final String name, final File part); HttpRequest part(final String name, final String filename,
      final File part); HttpRequest part(final String name, final String filename,
      final String contentType, final File part); HttpRequest part(final String name, final InputStream part); HttpRequest part(final String name, final String filename,
      final String contentType, final InputStream part); HttpRequest partHeader(final String name, final String value); HttpRequest send(final File input); HttpRequest send(final byte[] input); HttpRequest send(final InputStream input); HttpRequest send(final Reader input); HttpRequest send(final CharSequence value); OutputStreamWriter writer(); HttpRequest form(final Map<?, ?> values); HttpRequest form(final Entry<?, ?> entry); HttpRequest form(final Entry<?, ?> entry, final String charset); HttpRequest form(final Object name, final Object value); HttpRequest form(final Object name, final Object value, String charset); HttpRequest form(final Map<?, ?> values, final String charset); HttpRequest trustAllCerts(); HttpRequest trustAllHosts(); URL url(); String method(); HttpRequest useProxy(final String proxyHost, final int proxyPort); HttpRequest followRedirects(final boolean followRedirects); static final String CHARSET_UTF8; static final String CONTENT_TYPE_FORM; static final String CONTENT_TYPE_JSON; static final String ENCODING_GZIP; static final String HEADER_ACCEPT; static final String HEADER_ACCEPT_CHARSET; static final String HEADER_ACCEPT_ENCODING; static final String HEADER_AUTHORIZATION; static final String HEADER_CACHE_CONTROL; static final String HEADER_CONTENT_ENCODING; static final String HEADER_CONTENT_LENGTH; static final String HEADER_CONTENT_TYPE; static final String HEADER_DATE; static final String HEADER_ETAG; static final String HEADER_EXPIRES; static final String HEADER_IF_NONE_MATCH; static final String HEADER_LAST_MODIFIED; static final String HEADER_LOCATION; static final String HEADER_PROXY_AUTHORIZATION; static final String HEADER_REFERER; static final String HEADER_SERVER; static final String HEADER_USER_AGENT; static final String METHOD_DELETE; static final String METHOD_GET; static final String METHOD_HEAD; static final String METHOD_OPTIONS; static final String METHOD_POST; static final String METHOD_PUT; static final String METHOD_TRACE; static final String PARAM_CHARSET; }