org.jsoup
Interface Connection.Response

All Superinterfaces:
Connection.Base<Connection.Response>
All Known Implementing Classes:
HttpConnection.Response
Enclosing interface:
Connection

public static interface Connection.Response
extends Connection.Base<Connection.Response>

Represents a HTTP response.


Method Summary
 java.lang.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.
 java.lang.String charset()
          Get the character set name of the response.
 java.lang.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.
 java.lang.String statusMessage()
          Get the status message of the response.
 
Methods inherited from interface org.jsoup.Connection.Base
cookie, cookie, cookies, hasCookie, hasHeader, header, header, headers, method, method, removeCookie, removeHeader, url, url
 

Method Detail

statusCode

int statusCode()
Get the status code of the response.

Returns:
status code

statusMessage

java.lang.String statusMessage()
Get the status message of the response.

Returns:
status message

charset

java.lang.String charset()
Get the character set name of the response.

Returns:
character set name

contentType

java.lang.String contentType()
Get the response content type (e.g. "text/html");

Returns:
the response content type

parse

Document parse()
               throws java.io.IOException
Parse the body of the response as a Document.

Returns:
a parsed Document
Throws:
java.io.IOException - on error

body

java.lang.String body()
Get the body of the response as a plain string.

Returns:
body

bodyAsBytes

byte[] bodyAsBytes()
Get the body of the response as an array of bytes.

Returns:
body bytes


Copyright © 2009-2011 Jonathan Hedley. All Rights Reserved.