import requests
def benchmark_response():
headers = {
"Content-Type": "application/json"
}
response = requests.post(
url='http://localhost:8000/run',
headers=headers, json={'whatever': 1}, timeout=600,
)
job_id = response.json()['id']
print(job_id)
url = f'http://localhost:8000/stream/{job_id}'
while True:
get_status = requests.get(url, headers=headers)
print(get_status.text)
if __name__ == '__main__':
benchmark_response()
import requests
def benchmark_response():
headers = {
"Content-Type": "application/json"
}
response = requests.post(
url='http://localhost:8000/run',
headers=headers, json={'whatever': 1}, timeout=600,
)
job_id = response.json()['id']
print(job_id)
url = f'http://localhost:8000/stream/{job_id}'
while True:
get_status = requests.get(url, headers=headers)
print(get_status.text)
if __name__ == '__main__':
benchmark_response()