Skip to content

Instantly share code, notes, and snippets.

@alaa-aqeel
Created January 9, 2018 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alaa-aqeel/1f2bd73853844468bab628ec20908b46 to your computer and use it in GitHub Desktop.
Save alaa-aqeel/1f2bd73853844468bab628ec20908b46 to your computer and use it in GitHub Desktop.
# LogIn using requests #
import requests as req
log_url = 'http://localhost/btslab/admin/adminlogin.php'
session = req.Session()
#DATA LogIn
kw = {'data': {
'username':"admin",
'password':"password",
'Login':"Login"
}
}
post = req.Request("POST", log_url, **kw)
prepare = session.prepare_request(post)
resp = session.send(prepare)
# print(dir(resp))
print(resp.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment