Change status_code to status in http.response

This commit is contained in:
Andrew Godwin 2015-11-07 05:31:46 -08:00
parent 7b3845b0b2
commit 9222676bf7
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ def encode_response(response):
value = {
"content_type": getattr(response, "content_type", None),
"content": response.content,
"status_code": response.status_code,
"status": response.status_code,
"headers": list(response._headers.values()),
"cookies": [v.output(header="") for _, v in response.cookies.items()]
}
@ -26,7 +26,7 @@ def decode_response(value):
response = HttpResponse(
content = value['content'],
content_type = value['content_type'],
status = value['status_code'],
status = value['status'],
)
for cookie in value['cookies']:
response.cookies.load(cookie)

View File

@ -59,7 +59,7 @@ Only sent on reply channels.
Keys that must only be in the first message of a set:
* content_type: String, mimetype of content
* status_code: Integer, numerical HTTP status code
* status: Integer, numerical HTTP status code
* cookies: List of cookies to set (as encoded cookie strings suitable for headers)
* headers: Dictionary of headers (key is header name, value is value, both strings)