public HttpResponse(CloseableHttpResponse response) throws IOException {
HttpEntity entity = response.getEntity();
this.status = response.getStatusLine().getStatusCode();
this.reason = response.getStatusLine().getReasonPhrase();
this.body = (entity == null) ? null : EntityUtils.toByteArray(entity);
this.headers = new Multidict();
for (Header header : response.getAllHeaders()) {
headers.put(header.getName(), header.getValue());
}
}