I want to fetch 20000+ records so I tried to code the following python code and its work perfectly. but it's kinda slow. it takes 2-3sec/records so how to speed it up.
import requests
import sys
import time
from tqdm import tqdm
url = "https://www.example.org/web/api/Profile/users"
headers = {
'Content-Type': "application/x-www-form-urlencoded",
'Access-Control-Allow-Origin': "*",
'Accept-Encoding': "gzip, deflate",
'Accept-Language': "en-US",
}
n = (int(sys.argv[1]))
sum = 0
for i in tqdm(range(0,n)):
payload = "user_id={}".format(i+1)
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
sum = sum + i