Package co.cask.cdap.common.http.exception

Examples of co.cask.cdap.common.http.exception.HttpFailureException


  private AccessToken execute(HttpRequest request) throws IOException {
    HttpResponse response = HttpRequests.execute(request, getHttpRequestConfig());

    LOG.debug("Got response {} - {} from {}", response.getResponseCode(), response.getResponseMessage(), baseURI);
    if (response.getResponseCode() != HttpURLConnection.HTTP_OK) {
      throw new HttpFailureException(response.getResponseMessage(), response.getResponseCode());
    }

    Map<String, String> responseMap =
      ObjectResponse.fromJsonBody(response, new TypeToken<Map<String, String>>() { }).getResponseObject();
    String tokenValue = responseMap.get(ACCESS_TOKEN_KEY);
View Full Code Here

TOP

Related Classes of co.cask.cdap.common.http.exception.HttpFailureException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.