From 285c5ed36fe60731a244fe0de12e76c91753cb34 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 30 Apr 2010 10:33:56 -0700 Subject: [PATCH] Fix some styling in the docs --- doc/api.markdown | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/api.markdown b/doc/api.markdown index 28ec65f..254b6f8 100644 --- a/doc/api.markdown +++ b/doc/api.markdown @@ -1642,7 +1642,10 @@ the user--and passed as the first argument to a `'request'` listener. This is an EventEmitter with the following events: -- **`'data'`** - `callback(chunk)`: +### Event: 'data' + +`function (chunk) { }` + Emitted when a piece of the message body is received. Example: A chunk of the body is given as the single @@ -1650,7 +1653,10 @@ argument. The transfer-encoding has been decoded. The body chunk is a string. The body encoding is set with `request.setBodyEncoding()`. -- **`'end'`** - `callback()`: +### Event: 'end' + +`function () { }` + Emitted exactly once for each message. No arguments. After emitted no other events will be emitted on the request. @@ -1870,7 +1876,10 @@ event, the entire body will be caught. This is a writable stream. This is an `EventEmitter` with the following events: -- **`'response'`** - `callback(response)`: +### Event 'response' + +`function (response) { }` + Emitted when a response is received to this request. This event is emitted only once. The `response` argument will be an instance of `http.ClientResponse`. -- 2.7.4