Skip to content

Instantly share code, notes, and snippets.

@dubeyji10
Created July 25, 2022 12:19
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 dubeyji10/2639c4b817d0a9ee40c9cc281bbaf851 to your computer and use it in GitHub Desktop.
Save dubeyji10/2639c4b817d0a9ee40c9cc281bbaf851 to your computer and use it in GitHub Desktop.
Testing Login API call #1 Valid Credentials
import requests
# https://www.ontestautomation.com/writing-tests-for-restful-apis-in-python-using-requests-part-1-basic-tests/
print('trying to login a user with given credentials')
# test with dubeyji218 , password218 -- they are stored after hashing
userDict = {
'username':'dubeyji218',
'password':'password218',
}
print('user :',userDict)
print('making request')
#response = requests.post(url="http://localhost:8080/auth/post-test",data = userDict)
response = requests.post(url="http://localhost:8080/auth/login",data = userDict)
print("response : ",response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment