Package weibo4j.http

Examples of weibo4j.http.Response


      responseCode = responseFromServer.getResponseCode();
      log("Response:");
      log("https StatusCode:" + String.valueOf(responseCode));

      Response response = new Response();
      List<HTTPHeader> resposeHeaderList = responseFromServer
          .getHeaders();
      Header header = new Header();
      if (resposeHeaderList != null) {
        for (HTTPHeader httpHeader : resposeHeaderList) {
          if (httpHeader.getName().equals("Content-Type")) {
            header.setName(httpHeader.getName());
            header.setValue(httpHeader.getValue());
            break;
          }
        }
      }
      response.setResponseAsString(EncodingUtil.getString(
          responseFromServer.getContent(), getContentCharSet(header)));
      log(response.toString() + "\n");

      if (responseCode != OK)

      {
        log(response.asString());
        try {
          throw new WeiboException(getCause(responseCode),
              response.asJSONObject(), responseCode);
        } catch (JSONException e) {
          e.printStackTrace();
        }
      }
      return response;
View Full Code Here

TOP

Related Classes of weibo4j.http.Response

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.