diff options
author | Ryan <ry@tinyclouds.org> | 2009-06-12 17:37:43 +0200 |
---|---|---|
committer | Ryan <ry@tinyclouds.org> | 2009-06-12 17:37:43 +0200 |
commit | 916b9ca715b229b0703f0ed6c2fc065410fb189c (patch) | |
tree | 71d2f1cd177b49bc87d79be7c9b3307cc1b2db05 /website | |
parent | 825d7a8be83f2ef8956becad4cd42abb8c2a159b (diff) | |
download | node-new-916b9ca715b229b0703f0ed6c2fc065410fb189c.tar.gz |
Add Request objects on the HTTP server can be interrupted.v0.0.4
Diffstat (limited to 'website')
-rw-r--r-- | website/api.html | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/website/api.html b/website/api.html index 3290ae9d9b..fbbdb43fa8 100644 --- a/website/api.html +++ b/website/api.html @@ -622,7 +622,7 @@ server.listen(7000, "localhost");</pre> <code>"1.1"</code>, <code>"1.0"</code> </dd> - <dt><code>req.onBody</code></dt> + <dt><code>req.onBody = function (chunk) { }; </code></dt> <dd> Callback. Should be set by the user to be informed of when a piece of the message body is received. Example: @@ -640,7 +640,7 @@ req.onBody = function (chunk) { </p> </dd> - <dt><code>req.onBodyComplete</code></dt> + <dt><code>req.onBodyComplete = function () { };</code></dt> <dd> Callback. Made exactly once for each message. No arguments. After <code>onBodyComplete</code> is executed @@ -652,6 +652,14 @@ req.onBody = function (chunk) { Set the encoding for the request body. Either <code>"utf8"</code> or <code>"raw"</code>. Defaults to raw. </dd> + + <dt><code>req.interrupt()</code></dt> + <dd> + Interrupt the request. You will not receive anymore callbacks. + This is useful if, for example someone is streaming up a file but it + is too large and neesd to be stopped. The connection to the client + will be closed immediately. + </dd> </dl> <h3 id="http_server_response"><code>node.http.ServerResponse</code></h3> |