class HttpResponse {

  @NonNull
  public Result<String> getBodyString() {
    try {
      return success(new String(body, getHeaderFieldValue(CONTENT_TYPE)
          .ifSucceededAttemptMap(CHARSET_FROM_CONTENT_TYPE)
          .orElse(DEFAULT_CHARSET)));
    } catch (final UnsupportedEncodingException e) {
      return failure(e);
    }
  }

  private  HttpResponse(final int responseCode, @NonNull final String responseMessage,
      @NonNull final Map<String, String> header, @NonNull final byte[] body);

}