Answers for "read data from webserver lopy"

0

read data from webserver lopy

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')
Posted by: Guest on April-30-2020

Browse Popular Code Answers by Language