I have a list of users in a text file that I am reading into python, [john, mary, bob, alice]
I am trying to make an API call to an application to get information about the user profile in that application.
I am able to make a request using python request, the request URL looks like this:
url = https://my-application.com/api/v1/users/john
I can successfully make a single API call but I want to use python to loop through my list of users. So the question is, how do I get the request URL to replace the name of each users using a loop. I was guessing to use a for loop such as:
url = https://my-application.com/api/v1/users/%s.
for i in userlist:
return url + str[i]
This is not making much sense to me as I cannot get it working. Any help is appreciated.
Thanks