Skip to content

Instantly share code, notes, and snippets.

@raghavddps2
Created June 1, 2021 07:40
Show Gist options
  • Select an option

  • Save raghavddps2/b6f7d5fde47d158f518d7dbc9ad1eff9 to your computer and use it in GitHub Desktop.

Select an option

Save raghavddps2/b6f7d5fde47d158f518d7dbc9ad1eff9 to your computer and use it in GitHub Desktop.
import requests
def maskDataUpdate():
url = "localhost:5000/realtimeMask"
payload = {
"people_with_mask":20,
"people_without_mask":14
}
payload=str(payload)
headers = {
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
def trafficDataDemo():
url = "localhost:5000/realtimeTraffic"
payload= {
"bus_count":10,
"car_count":20,
"heavy_vehicle_count":30,
"pedestrian_count":40,
"other_vehicle_count":50,
"total_people_count":60,
"total_vehicle_count":70
}
headers = {
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
@raghavddps2
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment