📅  最后修改于: 2022-03-11 14:59:02.307000             🧑  作者: Mango
import urequests
sensorreading = 'whatever'
res = urequests.post('http://yourserver/endpoint', json={'my_sensor': sensorreading})
res.close()
if (res.status_code - 200) < 100: # check that response code is in the 200 range
print('done')
else:
print('there was some error')