Advertisement
Guest User

Untitled

a guest
Jan 13th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. var login = "mylogin";
  2. var password = "mypassword";
  3.  
  4. (async function getAllUserByProject(login, password, project) {
  5. var url = ``https://mycompany.myjetbrains.com/hub/api/rest/users?`;
  6. return new Promise((done, fail)=> {
  7. request.get({
  8. url, auth: {user: login, pass: password, sendImmediately: true}
  9. }, (error, body, result)=> {
  10. if (error || !result) {
  11. return fail({
  12. error: JSON.parse(error), result: result ? JSON.parse(result) : null
  13. })
  14. }
  15. console.log(result)
  16. done(JSON.parse(result));
  17. })
  18. })
  19. }
  20. )(login, password, project);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement