import requests
import json
import threading
data = {
  "amount": 2
}
def foo(data):
    try:
        r = requests.post(url = "www.mysite.com", data = data)
        j = json.loads(r.text)
        print(j)
    except requests.exceptions.RequestException as e:
        raise SystemExist(e)
threading.Timer(1, foo, [data]).start()
I want to run this http request every second using a thread in my program. However, the program only runs the http request once and exit. How do I fix this?
 
     
    