Hello So I have a list that I am trying to change the username and go down the list one at a time as it sends a request. For example I have a finallist.txt file that reads:
pop
boat
oreo
these are the list of usernames I want to send as the request. Here is my code:
list = open("finallist.txt", 'r')
paramsGet = {"Name": list}
headers = {<ignore>}
response = session.get("https://<ignore>.com/api/users/available", params=paramsGet, headers=headers)
if response.status_code == 200:
#
elif response.status_code == 409:
#
Note: I have all the required headers and syntax correct when the paramsGet - {"Name": pop} but when I try to have it rotate down the list I am lost. I assume I must do for x in range 3 try:? I do not know sorry if I did not make this clear.