nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
examples: annotate examples
[nit.git]
/
lib
/
nitcorn
/
http_response.nit
diff --git
a/lib/nitcorn/http_response.nit
b/lib/nitcorn/http_response.nit
index
3d0fd33
..
ec83289
100644
(file)
--- a/
lib/nitcorn/http_response.nit
+++ b/
lib/nitcorn/http_response.nit
@@
-19,8
+19,11
@@
# Provides the `HttpResponse` class and `http_status_codes`
module http_response
# Provides the `HttpResponse` class and `http_status_codes`
module http_response
+import serialization
+
# A response to send over HTTP
class HttpResponse
# A response to send over HTTP
class HttpResponse
+ serialize
# HTTP protocol version
var http_version = "HTTP/1.0" is writable
# HTTP protocol version
var http_version = "HTTP/1.0" is writable
@@
-46,7
+49,7
@@
class HttpResponse
# Set the content length if not already set
if not header.keys.has("Content-Length") then
# Size of the body
# Set the content length if not already set
if not header.keys.has("Content-Length") then
# Size of the body
- var len = body.bytelen
+ var len = body.byte_length
# Size of included files
for path in files do
# Size of included files
for path in files do
@@
-97,7
+100,8
@@
class HttpStatusCodes
# All know code and their message
var codes = new HashMap[Int, String]
# All know code and their message
var codes = new HashMap[Int, String]
- protected init do insert_status_codes
+ # Init the status `codes` list.
+ protected init is old_style_init do insert_status_codes
# Get the message associated to the status `code`, return `null` in unknown
fun [](code: Int): nullable String
# Get the message associated to the status `code`, return `null` in unknown
fun [](code: Int): nullable String