fetchAndConsume

Makes a GET request to the given URL and consumes the response.

Parameters

url

The URL to which the GET request is made.

consumer

A ResponseConsumer that consumes the HttpResponse instance.

Throws

If an issue occurs while making the request, which includes cases such as an unknown host. This is an instance of UnexpectedResponseException if the status code isn't 2xx.