mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
24 lines
467 B
JavaScript
24 lines
467 B
JavaScript
import networkRequest from 'request'
|
|
|
|
export default function (request, callback) {
|
|
const config = {
|
|
url: request.url,
|
|
method: request.method
|
|
};
|
|
|
|
if (request.authentication.username) {
|
|
config.auth = {
|
|
user: request.authentication.username,
|
|
pass: request.authentication.password
|
|
}
|
|
}
|
|
|
|
if (request.body) {
|
|
config.body = request.body;
|
|
}
|
|
|
|
networkRequest(config, function (err, response) {
|
|
callback(err, response);
|
|
});
|
|
}
|