[JavaScript, Node.js] ajax-lib
npm i -save ajax-lib
var ajax = require('ajax-lib')
ajax.get('https://google.com', function(err, response) {
//do something with response...
})
ajax.post('https://google.com', function(err, response) {
//do something with response...
})
ajax.put('https://google.com', function(err, response) {
//do something with response...
})
ajax.del('https://google.com', function(err, response) {
//do something with response...
})
var ajax = require('ajax-lib')
ajax.request('https://google.com', function(err, response) {
//do something with response...
})
ajax.request('https://google.com', {data:{}}, function(err, response) {
//without method => GET default
//do something with response...
})
var ajax = require('ajax-lib')
ajax.request('https://google.com', {
method:"POST",
data: {
formData: {
},
exampleData: {
}
}
},function(err, response) {
//do something with response...
})