### Question:
HttpConnection implements Connection { public Connection header(String name, String value) { req.header(name, value); return this; } HttpConnection(); static Connection connect(String url); static Connection connect(URL url); Connection url(URL url); Connection url(String url); Connection proxy(Proxy proxy); Connection proxy(String host, int port); Connection userAgent(String userAgent); Connection timeout(int millis); Connection maxBodySize(int bytes); Connection followRedirects(boolean followRedirects); Connection referrer(String referrer); Connection method(Method method); Connection ignoreHttpErrors(boolean ignoreHttpErrors); Connection ignoreContentType(boolean ignoreContentType); Connection data(String key, String value); Connection sslSocketFactory(SSLSocketFactory sslSocketFactory); Connection data(String key, String filename, InputStream inputStream); @Override Connection data(String key, String filename, InputStream inputStream, String contentType); Connection data(Map<String, String> data); Connection data(String... keyvals); Connection data(Collection<Connection.KeyVal> data); Connection.KeyVal data(String key); Connection requestBody(String body); Connection header(String name, String value); Connection headers(Map<String,String> headers); Connection cookie(String name, String value); Connection cookies(Map<String, String> cookies); Connection parser(Parser parser); Document get(); Document post(); Connection.Response execute(); Connection.Request request(); Connection request(Connection.Request request); Connection.Response response(); Connection response(Connection.Response response); Connection postDataCharset(String charset); static final String CONTENT_ENCODING; static final String DEFAULT_UA; static final String CONTENT_TYPE; static final String MULTIPART_FORM_DATA; static final String FORM_URL_ENCODED; }### Answer:
@Test @MultiLocaleTest public void caseInsensitiveHeaders() { Connection.Response res = new HttpConnection.Response(); res.header("Accept-Encoding", "gzip"); res.header("content-type", "text/html"); res.header("refErrer", "http: assertTrue(res.hasHeader("Accept-Encoding")); assertTrue(res.hasHeader("accept-encoding")); assertTrue(res.hasHeader("accept-Encoding")); assertTrue(res.hasHeader("ACCEPT-ENCODING")); assertEquals("gzip", res.header("accept-Encoding")); assertEquals("gzip", res.header("ACCEPT-ENCODING")); assertEquals("text/html", res.header("Content-Type")); assertEquals("http: res.removeHeader("Content-Type"); assertFalse(res.hasHeader("content-type")); res.removeHeader("ACCEPT-ENCODING"); assertFalse(res.hasHeader("Accept-Encoding")); res.header("ACCEPT-ENCODING", "deflate"); assertEquals("deflate", res.header("Accept-Encoding")); assertEquals("deflate", res.header("accept-Encoding")); }
@Test public void sameHeadersCombineWithComma() { Map<String, List<String>> headers = new HashMap<>(); List<String> values = new ArrayList<>(); values.add("no-cache"); values.add("no-store"); headers.put("Cache-Control", values); HttpConnection.Response res = new HttpConnection.Response(); res.processResponseHeaders(headers); assertEquals("no-cache, no-store", res.header("Cache-Control")); }