Hi there, i want to post my sensor data to my backend server. For that i used urequests library.
But i am getting the error status code of 426 which ingeneral means upgrade required. I want to kow how i can solve this problem.
i have attached the code i used
also i have checked urequests is using http 1.0, how to ugrade that also coz it is obselete now
`import machine
import urequests as requests
import network
import time
import ujson
Wifi Credentials
SSID = "xxxx"
PSK = "xxxxx"
def connect_to_wifi(ssid, psk):
Enable Wifi in Client Mode
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
# Connect to Wifi, keep trying until failure or success
wlan.connect(ssid, psk)
while not wlan.isconnected() and wlan.status() >= 0:
print("Waiting to Connect")
time.sleep(5)
if not wlan.isconnected():
raise Exception("Wifi not available")
print("Connected to WiFi")
Hi there, i want to post my sensor data to my backend server. For that i used urequests library.
But i am getting the error status code of 426 which ingeneral means upgrade required. I want to kow how i can solve this problem.
i have attached the code i used also i have checked urequests is using http 1.0, how to ugrade that also coz it is obselete now
`import machine import urequests as requests import network import time import ujson
Wifi Credentials
SSID = "xxxx" PSK = "xxxxx"
def connect_to_wifi(ssid, psk):
Enable Wifi in Client Mode
connect_to_wifi(SSID, PSK)
while True: try:
`