@Test public void testGetCharset() throws URISyntaxException { Multimap<String, String> headers = LinkedHashMultimap.create(); headers.put(HttpHeaders.CONTENT_TYPE, "text/html; charset=iso-8859-9"); RecordedHttpRequest recordedHttpRequest = new RecordedHttpRequest("GET", new URI("google.com"), headers, null); Assert.assertEquals(recordedHttpRequest.getCharset(), Charset.forName("iso-8859-9").toString()); }
public String getCharset() { Iterator<String> header = _headers.get(HttpHeaders.CONTENT_TYPE).iterator(); if (!header.hasNext()) { return DEFAULT_CHARSET; } else { return MediaType.parse(header.next()).charset().or(Charsets.UTF_8).toString(); } }
RecordedHttpMessage { public String getCharset() { Iterator<String> header = _headers.get(HttpHeaders.CONTENT_TYPE).iterator(); if (!header.hasNext()) { return DEFAULT_CHARSET; } else { return MediaType.parse(header.next()).charset().or(Charsets.UTF_8).toString(); } } }
RecordedHttpMessage { public String getCharset() { Iterator<String> header = _headers.get(HttpHeaders.CONTENT_TYPE).iterator(); if (!header.hasNext()) { return DEFAULT_CHARSET; } else { return MediaType.parse(header.next()).charset().or(Charsets.UTF_8).toString(); } } RecordedHttpMessage(Multimap<String, String> headers, RecordedHttpBody httpBody); }
RecordedHttpMessage { public String getCharset() { Iterator<String> header = _headers.get(HttpHeaders.CONTENT_TYPE).iterator(); if (!header.hasNext()) { return DEFAULT_CHARSET; } else { return MediaType.parse(header.next()).charset().or(Charsets.UTF_8).toString(); } } RecordedHttpMessage(Multimap<String, String> headers, RecordedHttpBody httpBody); RecordedHttpBody getHttpBody(); boolean hasHttpBody(); Multimap<String, String> getHeaders(); String getCharset(); String getContentType(); }
RecordedHttpMessage { public String getCharset() { Iterator<String> header = _headers.get(HttpHeaders.CONTENT_TYPE).iterator(); if (!header.hasNext()) { return DEFAULT_CHARSET; } else { return MediaType.parse(header.next()).charset().or(Charsets.UTF_8).toString(); } } RecordedHttpMessage(Multimap<String, String> headers, RecordedHttpBody httpBody); RecordedHttpBody getHttpBody(); boolean hasHttpBody(); Multimap<String, String> getHeaders(); String getCharset(); String getContentType();  }