Advertisement
Guest User

Untitled

a guest
Sep 21st, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var notificationValue= {"applicationId":"32769","schemaId":"32778","topicId":"32770","type":"USER"};
  2. var file = 'notification.json';
  3. var opts = {
  4. url: 'http://localhost:8080/kaaAdmin/rest/api/sendNotification',
  5. method: 'POST',
  6. auth: { user: 'devuser', password: 'devuser123' },
  7. json: true,
  8. formData: {
  9. notification: JSON.stringify(notificationValue),
  10. file : fs.readFileSync(file)
  11. }
  12.  
  13. };
  14. request(opts, function(err, resp, body) {
  15. if(err)
  16. res.send(err);
  17. else{
  18. res.send(body);
  19. }
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement