Response
type Response = HttpResponse
An incoming HTTP response.
Methods
status
pub fn status(self): StatusCode
[src]
pub fn status(self): StatusCode {
return (self as HttpResponse).status;
}
Returns the status code of the response.
status
pub fn status(self): StatusCode
[src]
pub fn status(self): StatusCode {
return (self as HttpResponse).status;
}
Returns the status code of the response.
Returns the status code of the response.
[src]
pub fn headers(self): Headers {
return (self as HttpResponse).headers;
}
Returns the headers of the response.
[src]
pub fn headers(self): Headers {
return (self as HttpResponse).headers;
}
Returns the headers of the response.
Returns the headers of the response.
[src]
pub fn body(self): ReadClose? {
return (self as HttpResponse).body;
}
Returns the body of the response.
[src]
pub fn body(self): ReadClose? {
return (self as HttpResponse).body;
}
Returns the body of the response.
Returns the body of the response.
[src]
pub fn text(self): string throws IoError, Utf8Error {
return try (self as HttpResponse).body?.read_to_string() || "";
}
Receives the body and parses it as utf8 string.
[src]
pub fn text(self): string throws IoError, Utf8Error {
return try (self as HttpResponse).body?.read_to_string() || "";
}
Receives the body and parses it as utf8 string.
Receives the body and parses it as utf8 string.
[src]
pub fn bytes(self): Bytes throws IoError {
let buf = Bytes.new();
if (let body = (self as HttpResponse).body) {
try body.read_to_end(buf);
}
return buf;
}
Receives the body as binary.
[src]
pub fn bytes(self): Bytes throws IoError {
let buf = Bytes.new();
if (let body = (self as HttpResponse).body) {
try body.read_to_end(buf);
}
return buf;
}
Receives the body as binary.
Receives the body as binary.
[src]
pub fn json<T>(self): T throws IoError, json.JsonError {
return try json.parse(self.bytes());
}
Parse the body as JSON.
[src]
pub fn json<T>(self): T throws IoError, json.JsonError {
return try json.parse(self.bytes());
}
Parse the body as JSON.
Parse the body as JSON.