HttpResponse

Constructors

this
this()
Undocumented in source.
this
this(HttpVersion ver, int status, HttpFields fields)
Undocumented in source.
this
this(HttpVersion ver, int status, HttpFields fields, long contentLength)
Undocumented in source.
this
this(HttpVersion ver, int status, string reason, HttpFields fields, long contentLength)
Undocumented in source.

Members

Aliases

code
alias code = getStatus
Undocumented in source.
message
alias message = getReason
Undocumented in source.
setHeader
deprecated alias setHeader = header
Undocumented in source.
withHeader
alias withHeader = header
Undocumented in source.
withHeaders
alias withHeaders = headers
Undocumented in source.

Functions

getReason
string getReason()

@return the HTTP reason

getStatus
int getStatus()

@return the HTTP status

header
HttpResponse header(string header, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
header
HttpResponse header(HttpHeader header, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
headers
HttpResponse headers(T[string] value)
Undocumented in source. Be warned that the author may not have intended to support it.
headers
HttpFields headers()
Undocumented in source. Be warned that the author may not have intended to support it.
headers
string[] headers(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
headers
string[] headers(HttpHeader header)
Undocumented in source. Be warned that the author may not have intended to support it.
isResponse
bool isResponse()
Undocumented in source. Be warned that the author may not have intended to support it.
isSuccessful
bool isSuccessful()

Returns true if the code is in [200..300), which means the request was successfully received, understood, and accepted.

setReason
void setReason(string reason)

@param reason the HTTP reason to set

setStatus
void setStatus(int status)

@param status the HTTP status to set

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_reason
string _reason;
Undocumented in source.
_status
int _status;
Undocumented in source.

Inherited Members

From HttpMetaData

ConntentTypeHeader
enum string ConntentTypeHeader;
Undocumented in source.
ConntentLengthHeader
enum string ConntentLengthHeader;
Undocumented in source.
_contentType
string _contentType;
Undocumented in source.
recycle
void recycle()
Undocumented in source. Be warned that the author may not have intended to support it.
isRequest
bool isRequest()
Undocumented in source. Be warned that the author may not have intended to support it.
isResponse
bool isResponse()
Undocumented in source. Be warned that the author may not have intended to support it.
haveBody
bool haveBody()
Undocumented in source. Be warned that the author may not have intended to support it.
getHttpVersion
HttpVersion getHttpVersion()

@return the HTTP version of this HttpMetaData object

setHttpVersion
void setHttpVersion(HttpVersion httpVersion)

@param httpVersion the HTTP version to set

getFields
HttpFields getFields()

@return the HTTP fields of this HttpMetaData object

getTrailerSupplier
Supplier!HttpFields getTrailerSupplier()
Undocumented in source. Be warned that the author may not have intended to support it.
setTrailerSupplier
void setTrailerSupplier(Supplier!HttpFields trailers)
Undocumented in source. Be warned that the author may not have intended to support it.
getBody
HttpBody getBody()

Returns a non-null value if this response was passed to {@link Callback#onResponse} or returned from {@link Call#execute()}. Response bodies must be {@linkplain ResponseBody closed} and may be consumed only once.

setBody
HttpMetaData setBody(HttpBody b)
Undocumented in source. Be warned that the author may not have intended to support it.
getContentLength
long getContentLength()

@return the content length if available, otherwise {@link Long#MIN_VALUE}

getContentType
string getContentType()
Undocumented in source. Be warned that the author may not have intended to support it.
headers
string[] headers(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
headers
string[] headers(HttpHeader header)
Undocumented in source. Be warned that the author may not have intended to support it.
header
string header(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
header
string header(HttpHeader h)
Undocumented in source. Be warned that the author may not have intended to support it.
headers
HttpFields headers()
Undocumented in source. Be warned that the author may not have intended to support it.
iterator
InputRange!HttpField iterator()

@return an iterator over the HTTP fields @see #getFields()

opApply
int opApply(int delegate(ref HttpField) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
withBody
alias withBody = setBody
Undocumented in source.

Meta