Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2017
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. const post_options = {
  2. url: 'https://connect.calamp.com',
  3. protocol: 'https:',
  4. host: 'connect.calamp.com',
  5. port: '443',
  6. path: '/connect/services/login?useAuthToken=true&username=' + encodeURIComponent('username') + '&password=' + encodeURIComponent('password'),
  7. method: 'POST',
  8. headers: {
  9. 'calamp-services-app': 'f12f0f55-28d7-4936-a102-58426cxxxxx'
  10. }
  11. };
  12.  
  13. const req = https.request(post_options, (res) => {
  14. console.log(res.statusCode) // 200
  15. });
  16.  
  17. req.write(JSON.stringify({}));
  18. req.end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement