public class HttpResponse extends HttpBase<HttpResponse>
| Modifier and Type | Field and Description |
|---|---|
protected HttpRequest |
httpRequest |
protected int |
statusCode |
protected java.lang.String |
statusPhrase |
body, charset, form, formEncoding, HEADER_ACCEPT_ENCODING, HEADER_CLOSE, HEADER_CONNECTION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_ETAG, HEADER_HOST, HEADER_KEEP_ALIVE, headers, HTTP_1_0, HTTP_1_1, httpVersion, mediaType| Constructor and Description |
|---|
HttpResponse() |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
close()
Closes requests connection if it was open.
|
HttpRequest |
getHttpRequest()
Returns
HttpRequest that created this response. |
static HttpResponse |
readFrom(java.io.InputStream in)
Reads response input stream and returns
response. |
int |
statusCode()
Returns response status code.
|
HttpResponse |
statusCode(int statusCode)
Sets response status code.
|
java.lang.String |
statusPhrase()
Returns response status phrase.
|
HttpResponse |
statusPhrase(java.lang.String statusPhrase)
Sets response status phrase.
|
java.lang.String |
toString()
String representation of the HTTP response.
|
java.lang.String |
toString(boolean fullResponse)
Returns full response or just headers.
|
HttpResponse |
unzip()
Unzips GZip-ed body content, removes the content-encoding header
and sets the new content-length value.
|
_header, acceptEncoding, acceptEncoding, body, body, body, bodyBytes, bodyText, bodyText, bodyText, bodyText, charset, charset, connectionKeepAlive, contentEncoding, contentLength, contentLength, contentType, contentType, contentType, form, form, form, form, form, formEncoding, formString, header, header, header, header, header, headers, httpVersion, httpVersion, initForm, isConnectionPersistent, isFormMultipart, mediaType, mediaType, readBody, readHeaders, removeHeader, sendTo, toByteArray, wrapFormValueprotected int statusCode
protected java.lang.String statusPhrase
protected HttpRequest httpRequest
public int statusCode()
public HttpResponse statusCode(int statusCode)
public java.lang.String statusPhrase()
public HttpResponse statusPhrase(java.lang.String statusPhrase)
public HttpResponse unzip()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(boolean fullResponse)
public static HttpResponse readFrom(java.io.InputStream in)
response.
Supports both streamed and chunked response.public HttpRequest getHttpRequest()
HttpRequest that created this response.public HttpResponse close()
Copyright © 2003-2013 Jodd Team