ensureAuthentication();
final URL url = prepareUrl(target);
final AsyncHttpClient.BoundRequestBuilder requestBuilder = requestBuilderForUrl(url);
requestBuilder.addHeader(Http.HeaderNames.ACCEPT, mediaType.toString());
final Request request = requestBuilder.build();
if (LOG.isDebugEnabled()) {
LOG.debug("API Request: {}", request.toString());
}
// Set 200 OK as standard if not defined.
if (expectedResponseCodes.isEmpty()) {
expectedResponseCodes.add(Http.Status.OK);