x-http-client
Version:
An http client to make it easier to send requests (including JSONP requests) to the server.
18 lines (14 loc) • 490 B
JavaScript
var isFunction = require('x-common-utils/isFunction');
/**
* The function to call `options.onRequestCreated` callback.
*
* @param {RequestOptions} options The request options.
* @param {HttpRequest|JSONPRequest} request The request instance.
*/
function callRequestCreatedCallback(options, request) {
var onRequestCreated = options.onRequestCreated;
if (isFunction(onRequestCreated)) {
onRequestCreated(request);
}
}
module.exports = callRequestCreatedCallback;