HTTP REST Sensor Upload
Write a Python script to upload sensor measurements to a REST endpoint using HTTP POST. Handle JSON serialization and connection errors.
Constraints
- Use requests library.
- Endpoint: http://example.com/data.
- JSON format: {"id":X,"value":Y}.
- Timeout of 5 seconds.
- Retry once on failure.
1import requests2# TODO