📜  从网络服务器 lopy 读取数据 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:02.307000             🧑  作者: Mango

代码示例1
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')