private static Charset getResponseCharset(Map<String, Collection<String>> headers) {

      Collection<String> strings = headers.get("content-type");
      if (strings == null || strings.isEmpty()) {
        return null;
      }

      Pattern pattern = Pattern.compile(".*charset=\"?([^\\s|^;|^\"]+).*", CASE_INSENSITIVE);
      Matcher matcher = pattern.matcher(strings.iterator().next());
      if (!matcher.lookingAt()) {
        return null;
      }

      String group = matcher.group(1);
      try {
        if (!Charset.isSupported(group)) {
          return null;
        }
      } catch (IllegalCharsetNameException ex) {
        return null;
      }
      return Charset.forName(group);
    }
The Response body.

@return an Optional wrapping the response body.
core/src/main/java/feign/FeignException.java