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