public static class HttpConnection.Response extends Object implements Connection.Response
Modifier and Type | Method and Description |
---|---|
String |
body()
Get the body of the response as a plain string.
|
byte[] |
bodyAsBytes()
Get the body of the response as an array of bytes.
|
String |
charset()
Get the character set name of the response, derived from the content-type header.
|
HttpConnection.Response |
charset(String charset)
Set / override the response character set.
|
String |
contentType()
Get the response content type (e.g.
|
Document |
parse()
Parse the body of the response as a Document.
|
int |
statusCode()
Get the status code of the response.
|
String |
statusMessage()
Get the status message of the response.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cookie, cookie, cookies, hasCookie, hasHeader, hasHeaderWithValue, header, header, headers, method, method, removeCookie, removeHeader, url, url
public int statusCode()
Connection.Response
statusCode
in interface Connection.Response
public String statusMessage()
Connection.Response
statusMessage
in interface Connection.Response
public String charset()
Connection.Response
charset
in interface Connection.Response
public HttpConnection.Response charset(String charset)
Connection.Response
charset
in interface Connection.Response
charset
- to decode body aspublic String contentType()
Connection.Response
contentType
in interface Connection.Response
public Document parse() throws IOException
Connection.Response
parse
in interface Connection.Response
IOException
- on errorpublic String body()
Connection.Response
body
in interface Connection.Response
public byte[] bodyAsBytes()
Connection.Response
bodyAsBytes
in interface Connection.Response
Copyright © 2017. All rights reserved.