summaryrefslogtreecommitdiff
path: root/cli/ops
diff options
context:
space:
mode:
Diffstat (limited to 'cli/ops')
-rw-r--r--cli/ops/fetch.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs
index afda07f75..f69065f1d 100644
--- a/cli/ops/fetch.rs
+++ b/cli/ops/fetch.rs
@@ -50,7 +50,7 @@ pub fn op_fetch(
}
debug!("Before fetch {}", url);
let future = request.send().map_err(ErrBox::from).and_then(move |res| {
- let status = res.status().as_u16();
+ let status = res.status();
let mut res_headers = Vec::new();
for (key, val) in res.headers().iter() {
res_headers.push((key.to_string(), val.to_str().unwrap().to_owned()));
@@ -61,7 +61,8 @@ pub fn op_fetch(
let json_res = json!({
"bodyRid": body_resource.rid,
- "status": status,
+ "status": status.as_u16(),
+ "statusText": status.canonical_reason().unwrap_or(""),
"headers": res_headers
});