backbone-sdb.js
function httpRequest(options, body, callback) {
		// The `processResponse` callback should only be called once. The [http docs](http://nodejs.org/api/http.html#http_event_close_1)
		// say that a 'close' event can be fired after the 'end' event has been fired. To ensure that the `processResponse` callback
		// is called only once it is wrapped by `_.once()`
		var processResponse = _.once(function(error, responseBody, httpResponse) {
			if (!error && httpResponse && httpResponse.statusCode !== 200) error = httpResponse.statusCode;
			if (_.isFunction(callback)) callback(error, responseBody, httpResponse);
		});

		var request = http.request(options, function(httpResponse) {
			var responseBody = '';
			httpResponse.on('data', function(data) {
				responseBody += data.toString(); // 'data' can be a String or a Buffer object
			}).on('close', function(error) {
				processResponse(error, responseBody, httpResponse);
			}).on('end', function() {
				processResponse(undefined, responseBody, httpResponse);
			});
		}).on('error', processResponse);

		if (!_.isEmpty(body)) request.write(body);
		request.end();
	}
function httpRequest(options, body, callback) {
		// The `processResponse` callback should only be called once. The [http docs](http://nodejs.org/api/http.html#http_event_close_1)
		// say that a 'close' event can be fired after the 'end' event has been fired. To ensure that the `processResponse` callback
		// is called only once it is wrapped by `_.once()`
		var processResponse = _.once(function(error, responseBody, httpResponse) {
			if (!error && httpResponse && httpResponse.statusCode !== 200) error = httpResponse.statusCode;
			if (_.isFunction(callback)) callback(error, responseBody, httpResponse);
		});

		var request = http.request(options, function(httpResponse) {
			var responseBody = '';
			httpResponse.on('data', function(data) {
				responseBody += data.toString(); // 'data' can be a String or a Buffer object
			}).on('close', function(error) {
				processResponse(error, responseBody, httpResponse);
			}).on('end', function() {
				processResponse(undefined, responseBody, httpResponse);
			});
		}).on('error', processResponse);

		if (!_.isEmpty(body)) request.write(body);
		request.end();
	}
function httpRequest ( options , body , callback ) { // The `processResponse` callback should only be called once. The [http docs](http://nodejs.org/api/http.html#http_event_close_1) // say that a 'close' event can be fired after the 'end' event has been fired. To ensure that the `processResponse` callback // is called only once it is wrapped by `_.once()` var processResponse = _ . once ( function ( error , responseBody , httpResponse ) { if ( ! error && httpResponse && httpResponse . statusCode !== 200 ) error = httpResponse . statusCode ; if ( _ . isFunction ( callback ) ) callback ( error , responseBody , httpResponse ) ; } ) ; var request = http . request ( options , function ( httpResponse ) { var responseBody = '' ; httpResponse . on ( 'data' , function ( data ) { responseBody += data . toString ( ) ; // 'data' can be a String or a Buffer object } ) . on ( 'close' , function ( error ) { processResponse ( error , responseBody , httpResponse ) ; } ) . on ( 'end' , function ( ) { processResponse ( undefined , responseBody , httpResponse ) ; } ) ; } ) . on ( 'error' , processResponse ) ; if ( ! _ . isEmpty ( body ) ) request . write ( body ) ; request . end ( ) ; }
This is the method that send the actual HTTP requests, caches the response, and executes the callback after the response has been received.

@method httpRequest
@private
@param {Object} options The [HTTP options](http://nodejs.org/api/http.html#http_http_request_options_callback) to use when sending the request.
@param {Buffer|String} body The request's body. Must be a [Buffer](http://nodejs.org/api/buffer.html) or a String.
Set it to `null`, `undefined`, `false`, or `''` to send a request with no body (a `GET` request for instance).
@param {Function} [callback] Callback function to call after the response has been received.
This is the method that send the actual HTTP requests caches the response and executes the callback after the response has been received .