Advertisement
Guest User

python requests

a guest
Apr 26th, 2015
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. import requests as r
  2. from requests.auth import HTTPBasicAuth as auth
  3.  
  4. vst_hostname = 'https://188.188.188.88/api'
  5. vst_username = 'admin'
  6. vst_password = 'p4ssw0rd'
  7. vst_returncode = 'yes'
  8. vst_command = 'v-add-user'
  9.  
  10. # New Account
  11. username = 'demo'
  12. password = 'd3m0p4ssw0rd'
  13. email = 'demo@gmail.com'
  14. package = 'default'
  15. fist_name = 'Rust'
  16. last_name = 'Cohle'
  17.  
  18. # Prepare POST query
  19. postvars = {
  20.     'cmd': vst_command,
  21.     'arg1': username,
  22.     'arg2': password,
  23.     'arg3': email,
  24.     'arg4': package,
  25.     'arg5': fist_name,
  26.     'arg6': last_name
  27. }
  28.  
  29. r.packages.urllib3.disable_warnings()
  30. req = r.post(vst_hostname, auth(vst_username, vst_hostname) , params=postvars, verify=False )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement