public class HttpResponse extends HttpBase<HttpResponse>
HttpBase.Defaults
Modifier and Type | Field and Description |
---|---|
protected HttpRequest |
httpRequest |
protected int |
statusCode |
protected java.lang.String |
statusPhrase |
body, capitalizeHeaderKeys, charset, form, formEncoding, HEADER_ACCEPT, HEADER_ACCEPT_ENCODING, HEADER_AUTHORIZATION, 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, httpProgressListener, httpVersion, mediaType, multipart
Constructor and Description |
---|
HttpResponse() |
Modifier and Type | Method and Description |
---|---|
protected Buffer |
buffer(boolean fullResponse)
Creates response
buffer . |
HttpResponse |
close()
Closes requests connection if it was open.
|
Cookie[] |
cookies()
Returns list of valid cookies sent from server.
|
HttpRequest |
getHttpRequest()
Returns
HttpRequest that created this response. |
java.lang.String |
location()
Parses 'location' header to return the next location or returns
null if location not specified. |
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.
|
HttpResponse |
unzip()
Unzips GZip-ed body content, removes the content-encoding header
and sets the new content-length value.
|
_header, _headerRaw, _this, accept, accept, acceptEncoding, acceptEncoding, body, body, body, bodyBytes, bodyText, bodyText, bodyText, bodyText, capitalizeHeaderKeys, capitalizeHeaderKeys, charset, charset, connectionKeepAlive, contentEncoding, contentLength, contentLength, contentType, contentType, contentType, form, form, form, form, formBuffer, formEncoding, formOverwrite, header, header, header, header, header, headerNames, headerOverwrite, headerRemove, headers, httpVersion, httpVersion, initForm, isConnectionPersistent, isFormMultipart, mediaType, mediaType, populateHeaderAndBody, readBody, readHeaders, resolveFormEncoding, sendTo, toByteArray, tokenAuthentication, toString, toString, wrapFormValue
protected 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 java.lang.String location()
public Cookie[] cookies()
cookies
in class HttpBase<HttpResponse>
public HttpResponse unzip()
protected Buffer buffer(boolean fullResponse)
buffer
.buffer
in class HttpBase<HttpResponse>
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-present Jodd Team