io-nodejs.js revision 4b4540713faf16bc8db41c5e2426bac98eecc0ca
/*global Y: false, Buffer: false, clearInterval: false, clearTimeout: false, console: false, exports: false, global: false, module: false, process: false, querystring: false, require: false, setInterval: false, setTimeout: false, __filename: false, __dirname: false */
/**
* Passthru to the NodeJS <a href="https://github.com/mikeal/request">request</a> module.
* This method is return of `require('request')` so you can use it inside NodeJS without
* the IO abstraction.
* @method request
* @static
*/
}
/**
NodeJS IO transport, uses the NodeJS <a href="https://github.com/mikeal/request">request</a>
module under the hood to perform all network IO.
@method transports.nodejs
@static
@returns {Object} This object contains only a `send` method that accepts a
`transaction object`, `uri` and the `config object`.
@example
Y.io('https://somedomain.com/url', {
method: 'PUT',
data: '?foo=bar',
//Extra request module config options.
request: {
maxRedirects: 100,
strictSSL: true,
multipart: [
{
'content-type': 'application/json',
body: JSON.stringify({
foo: 'bar',
_attachments: {
'message.txt': {
follows: true,
length: 18,
}
}
})
},
{
body: 'I am an attachment'
}
]
},
on: {
success: function(id, e) {
Y.log(e.responseText);
}
}
});
*/
// Return an object that has a send method. IO
// will route the prepared request data to this
// method with arguments: the transaction object,
// uri, and the configuration object.
return {
var rconf = {
};
}
}
err = {
};
}
if (err) {
return;
}
if (data) {
transaction.c = {
responseXML: null
};
}
});
}
};
};