public void content(HttpResponse response) throws IOException { //Result result = response.parseAs(Result.class); System.out.println(response.getStatusCode()); System.out.println(response.getStatusMessage()); System.out.println(response.getContentType()); InputStream is = response.getContent(); int ch; while ((ch = is.read()) != -1) { System.out.print((char) ch); } response.disconnect(); }
InputStream content = response.getContent(); try { Atom.checkContentType(response.getContentType()); XmlPullParser parser = Xml.createParser(); parser.setInput(content, null);
String contentType = httpResponse.getContentType();
String contentType = httpResponse.getContentType();
if (!httpResponse.isSuccessStatusCode()) { throw makeException(url, methodName, httpResponse.getContent(), httpResponse.getContentType(), httpResponse.getContentCharset(), null, httpResponse.getStatusCode());
protected JdcloudResponse handlerHttpResponse(HttpResponse httpResponse) throws IOException,IllegalAccessException,InstantiationException, JAXBException{ String contentType = httpResponse.getContentType(); if(httpResponse.getContent() != null && httpResponse.getStatusCode() != 204 && httpResponse.getStatusCode() != 304) { JdcloudResponse response; if(ContentType.TEXT_XML.toString().equals(contentType)) { response = (JdcloudResponse) getUnmarshaller().unmarshall(ConvertUtils.xmlToJson(httpResponse.getContent())); } else { response = (JdcloudResponse) getUnmarshaller().unmarshall(jdcloudClient.readValue(httpResponse.getContent())); } if (null == response){ throw new JdcloudSdkException("Illegal Content"); } response.setOriginalResponse(httpResponse); return response; } Object o = httpResponse.getHeaders().get("x-jdcloud-request-id"); if(o instanceof ArrayList) { String reqId = (String)((ArrayList) o).get(0); JdcloudResponse ret = returnType().newInstance(); ret.setRequestId(reqId); ret.setOriginalResponse(httpResponse); return ret; } return returnType().newInstance(); }
try (InputStream content = GzipFixingInputStream.maybeWrap(httpResponse.getContent())) { throw makeException(url, methodName, content, httpResponse.getContentType(), httpResponse.getContentCharset(), null, httpResponse.getStatusCode());
try (InputStream content = GzipFixingInputStream.maybeWrap(httpResponse.getContent())) { throw makeException(url, methodName, content, httpResponse.getContentType(), httpResponse.getContentCharset(), null, httpResponse.getStatusCode());
try { if (!response.isSuccessStatusCode() && HttpMediaType.equalsIgnoreParameters(Json.MEDIA_TYPE, response.getContentType()) && response.getContent() != null) { JsonParser parser = null;