Package org.jsoup.helper
Class HttpConnection.Response
- java.lang.Object
-
- org.jsoup.helper.HttpConnection.Response
-
- All Implemented Interfaces:
Connection.Base<Connection.Response>,Connection.Response
- Enclosing class:
- HttpConnection
public static class HttpConnection.Response extends java.lang.Object implements Connection.Response
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringbody()Get the body of the response as a plain string.byte[]bodyAsBytes()Get the body of the response as an array of bytes.java.lang.Stringcharset()Get the character set name of the response, derived from the content-type header.HttpConnection.Responsecharset(java.lang.String charset)Set / override the response character set.java.lang.StringcontentType()Get the response content type (e.g.Documentparse()Parse the body of the response as a Document.intstatusCode()Get the status code of the response.java.lang.StringstatusMessage()Get the status message of the response.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jsoup.Connection.Base
cookie, cookie, cookies, hasCookie, hasHeader, hasHeaderWithValue, header, header, headers, method, method, removeCookie, removeHeader, url, url
-
-
-
-
Method Detail
-
statusCode
public int statusCode()
Description copied from interface:Connection.ResponseGet the status code of the response.- Specified by:
statusCodein interfaceConnection.Response- Returns:
- status code
-
statusMessage
public java.lang.String statusMessage()
Description copied from interface:Connection.ResponseGet the status message of the response.- Specified by:
statusMessagein interfaceConnection.Response- Returns:
- status message
-
charset
public java.lang.String charset()
Description copied from interface:Connection.ResponseGet the character set name of the response, derived from the content-type header.- Specified by:
charsetin interfaceConnection.Response- Returns:
- character set name
-
charset
public HttpConnection.Response charset(java.lang.String charset)
Description copied from interface:Connection.ResponseSet / override the response character set. When the document body is parsed it will be with this charset.- Specified by:
charsetin interfaceConnection.Response- Parameters:
charset- to decode body as- Returns:
- this Response, for chaining
-
contentType
public java.lang.String contentType()
Description copied from interface:Connection.ResponseGet the response content type (e.g. "text/html");- Specified by:
contentTypein interfaceConnection.Response- Returns:
- the response content type
-
parse
public Document parse() throws java.io.IOException
Description copied from interface:Connection.ResponseParse the body of the response as a Document.- Specified by:
parsein interfaceConnection.Response- Returns:
- a parsed Document
- Throws:
java.io.IOException- on error
-
body
public java.lang.String body()
Description copied from interface:Connection.ResponseGet the body of the response as a plain string.- Specified by:
bodyin interfaceConnection.Response- Returns:
- body
-
bodyAsBytes
public byte[] bodyAsBytes()
Description copied from interface:Connection.ResponseGet the body of the response as an array of bytes.- Specified by:
bodyAsBytesin interfaceConnection.Response- Returns:
- body bytes
-
-