diff options
author | Mark Nottingham <mnot@mnot.net> | 2010-09-09 16:29:35 +1000 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-09-14 15:20:45 -0700 |
commit | 4fe3007a1ae4c35e18d297af3151eb51d0458859 (patch) | |
tree | 24447426383f8759d8d3b6461141829262ccbae6 /doc | |
parent | 83ff473d30c45baa2c975793a7ffee06f19e0b3b (diff) | |
download | nodejs-4fe3007a1ae4c35e18d297af3151eb51d0458859.tar.gz nodejs-4fe3007a1ae4c35e18d297af3151eb51d0458859.tar.bz2 nodejs-4fe3007a1ae4c35e18d297af3151eb51d0458859.zip |
Support for outgoing HTTP trailing headers
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api.markdown | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/api.markdown b/doc/api.markdown index 0b0ecee9f..e5109c296 100644 --- a/doc/api.markdown +++ b/doc/api.markdown @@ -1894,6 +1894,24 @@ header information and the first body to the client. The second time data, and sends that separately. That is, the response is buffered up to the first chunk of body. +### response.addTrailers(headers) + +This method adds HTTP trailing headers (a header but at the end of the +message) to the response. + +Trailers will **only** be emitted if chunked encoding is used for the +response; if it is not (e.g., if the request was HTTP/1.0), they will +be silently discarded. + +Note that HTTP requires the `Trailer` header to be sent if you intend to +emit trailers, with a list of the header fields in its value. E.g., + + response.writeHead(200, { 'Content-Type': 'text/plain', + 'Trailer': 'TraceInfo' }); + response.write(fileData); + response.addTrailers({'Content-MD5': "7895bf4b8828b55ceaf47747b4bca667"}); + response.end(); + ### response.end([data], [encoding]) |