Guest User

Untitled

a guest
Feb 19th, 2018
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Request: require('request').Request
  2. _makeCall:function(callback){
  3. Request({
  4. url: 'URL-TO-API',
  5. contentType: "application/x-www-form-urlencoded; charset=iso-8859-1",
  6. content: {
  7. op: 'OPERATION-TO-CALL,
  8. password: 'super-sec,
  9. user: 'me@gmail.com'
  10. },
  11. onComplete: function (response) {
  12. if(response.status == 200){
  13. callback(response.text);
  14. }
  15. else{
  16. callback('');
  17. }
  18. }
  19. });
  20. req.post();
  21. }
Add Comment
Please, Sign In to add comment