dyndb.js
function sendRequest(operationName, body, callback, context) {
		if (_.isFunction(body)) {
			context = callback;
			callback = body;
			body = undefined;
		}
		body || (body = {});
		body = new Buffer(_.isString(body) ? body : JSON.stringify(body));

		var httpOpts = {
			host: SERVICE_NAME.toLowerCase() + '.' + region + '.amazonaws.com',
			port: 443,
			path: '/',
			method: 'POST',
			headers: {
				'x-amz-date': basicISODate(),
				'x-amz-target': SERVICE_NAME + '_' + API_VERSION + '.' + operationName,
				'Content-Type': 'application/x-amz-json-1.0'
			}
		};
		signRequest(httpOpts, body);

		httpRequest(httpOpts, body, function(error, responseBody, httpResponse) {
			var json;
			try {
				json = JSON.parse(responseBody);
			} catch (parseError) {
				if (!error) error = parseError;
			}

			if (_.isFunction(callback)) callback.call(context || httpResponse, error, json || responseBody);
		}, true);
	}
function sendRequest(operationName, body, callback, context) {
		if (_.isFunction(body)) {
			context = callback;
			callback = body;
			body = undefined;
		}
		body || (body = {});
		body = new Buffer(_.isString(body) ? body : JSON.stringify(body));

		var httpOpts = {
			host: SERVICE_NAME.toLowerCase() + '.' + region + '.amazonaws.com',
			port: 443,
			path: '/',
			method: 'POST',
			headers: {
				'x-amz-date': basicISODate(),
				'x-amz-target': SERVICE_NAME + '_' + API_VERSION + '.' + operationName,
				'Content-Type': 'application/x-amz-json-1.0'
			}
		};
		signRequest(httpOpts, body);

		httpRequest(httpOpts, body, function(error, responseBody, httpResponse) {
			var json;
			try {
				json = JSON.parse(responseBody);
			} catch (parseError) {
				if (!error) error = parseError;
			}

			if (_.isFunction(callback)) callback.call(context || httpResponse, error, json || responseBody);
		}, true);
	}
function sendRequest ( operationName , body , callback , context ) { if ( _ . isFunction ( body ) ) { context = callback ; callback = body ; body = undefined ; } body || ( body = { } ) ; body = new Buffer ( _ . isString ( body ) ? body : JSON . stringify ( body ) ) ; var httpOpts = { host : SERVICE_NAME . toLowerCase ( ) + '.' + region + '.amazonaws.com' , port : 443 , path : '/' , method : 'POST' , headers : { 'x-amz-date' : basicISODate ( ) , 'x-amz-target' : SERVICE_NAME + '_' + API_VERSION + '.' + operationName , 'Content-Type' : 'application/x-amz-json-1.0' } } ; signRequest ( httpOpts , body ) ; httpRequest ( httpOpts , body , function ( error , responseBody , httpResponse ) { var json ; try { json = JSON . parse ( responseBody ) ; } catch ( parseError ) { if ( ! error ) error = parseError ; } if ( _ . isFunction ( callback ) ) callback . call ( context || httpResponse , error , json || responseBody ) ; } , true ) ; }
Underlying method that builds the request before sending it and relays the response to the callback.

@method sendRequest
@private
@param {String} operationName Name of the DynamoDB operation to request.
@param {Object|String} [body='{}'] Body of the request.
@param {Function} [callback] Callback function to call after receiving the response.
@param {Object} [context=httpResponseObject] Context in which the callback should be executed.
Defaults to the underlying HTTP response object.
Underlying method that builds the request before sending it and relays the response to the callback .