Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl -i -X POST -d username=admin -d password='pass' -c ./cookies.txt http://ip_address:9080/nbapiemswsweb/login
- curl -v -i -H “Content-Type:application/json” -X GET -b ./cookies.txt 'http://ip_address:9080/nbapiemswsweb/rest/v1/Search/Element'
- import requests
- from requests.auth import HTTPDigestAuth
- import json
- url = "http://IP_ADDRESS:9080/nbapiemswsweb/login"
- myResponse = requests.post(url,auth=HTTPDigestAuth(raw_input("username: "), raw_input("Password: ")), verify=True)
- print (myResponse.status_code)
- python restapi.py
- username: admin
- Password: pass
- 401
Add Comment
Please, Sign In to add comment