Advertisement
rodrigofbm

Untitled

Dec 10th, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const request = require('request');
  2.  
  3. const options = {
  4.   url: 'https://ln....api.infobip.com/sms/2/text/single',
  5.   json: {
  6.     from: 'Infobip',
  7.     to: '5573991626817',
  8.     text: 'Teste'
  9. },
  10.   headers: {
  11.     'Authorization': 'App ca8c0e09e3ad4058f5b462e...',
  12.     'Content-Type': 'application/json',
  13.     'Accept': 'application/json'
  14.   }
  15. }
  16.  
  17. request.post(options,(err, response) => {
  18.   if (err){
  19.     return console.log(err)
  20.   }
  21.  
  22.   console.log(`Status code: ${response.statusCode}. Message: ${response.body}`);
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement