Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Request: require('request').Request
- _makeCall:function(callback){
- Request({
- url: 'URL-TO-API',
- contentType: "application/x-www-form-urlencoded; charset=iso-8859-1",
- content: {
- op: 'OPERATION-TO-CALL,
- password: 'super-sec,
- user: 'me@gmail.com'
- },
- onComplete: function (response) {
- if(response.status == 200){
- callback(response.text);
- }
- else{
- callback('');
- }
- }
- });
- req.post();
- }
Add Comment
Please, Sign In to add comment