Relative Content

Tag Archive for apache-httpclient-5.x

Is there any way to get Headers from HttpResponse in HttpClient5?

In Apache HTTP Components 4, I could get Header[] from HttpResponse by using the method getAllHeaders(), cause this method extends from class HttpMessage. However, after upgrading my dependency to 5.x, I found that this method has been removed from class HttpResponse. The only solution I found is to change HttpResponse to CloseableHttpResponse then use method getHeaders(). Is this the correct approach?