startup_request.py 268 B

1234567891011121314
  1. import threading
  2. import requests
  3. def auto_request():
  4. url = 'http://localhost:8087/update_water_quality'
  5. headers = {'Content-Type': 'application/json'}
  6. response = requests.get(url)
  7. print(response.text)
  8. threading.Timer(15,auto_request).start()