io-nodejs.js revision e7a8de4b7486f0890b36c9effa2703630dd6faa5
/*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);
}
}
});
*/
var flatten = function(o) {
var str = [];
});
};
return {
var rconf = {
};
}
}
}
}
if (err) {
transaction.c = err;
return;
}
if (data) {
transaction.c = {
responseXML: null,
getResponseHeader: function(name) {
},
getAllResponseHeaders: function() {
}
};
}
config.notify(((data && (data.statusCode >= 200 && data.statusCode <= 299)) ? 'success' : 'failure'), transaction, config);
});
var ret = {
};
return ret;
}
};
};