0

I have even tried reducing the length of data, but it's not working

import requests
import time
import json

with open("Iris.csv") as f:
line = f.readline()
headers = line.strip().split(",")
features = []
for l in f.readlines():
features.append(list(map(lambda x: float(x), l.strip().split(",")\[1:-1\])))
models = ["onnx","pmml","pfa"]

for _ in range(600):
data1 = requests.post("https://axscdfd/score", json={
        "models": models,
        "x": features,
         }, headers={"Authorization": "Bearer abcdefght"}, timeout=(100,100))
print(data1.content)
time.sleep(2)

I tried running this code, and am expecting it to upload the data and print {}

deepthi
  • 1
  • 1
  • Welcome to Stack Overflow. What do you mean by "it's not working"? What is your actual output? What is the full traceback error? Please also format your code properly. – ewokx Feb 27 '23 at 07:21
  • I couldnt get output, even if its running.It is not an error actually, But I dont know how to fix this issue. It should actually print b'{}'. but it is printing b'upstream request timeout' – deepthi Feb 28 '23 at 03:40
  • Well, 'upstream time out' tends to be an issue with the server not responding in time. Perhaps take a look at https://stackoverflow.com/questions/21965484/timeout-for-python-requests-get-entire-response – ewokx Feb 28 '23 at 03:42

0 Answers0