Using requests.get


#1

I am trying to use requests.get(url,params={‘msg’:‘nigel’}) to pass some data to my php script. this works on my desktop machine. I am not able to receive the same data from the ESP32 when running the same code? I never see the data at the php end and get a ‘301 Moved Permanently’ response?

for i in range(3):
    try:
        print("Trying to connect...")
        payload = {'msg':'david'}
        response = requests.get("http://myurl.com", params=payload)
        break
    except Exception as e:
        print(e)

try:
    print("Success!!")
    print("-------------")
    print("And the result is:",response.content)
    print("-------------")
except Exception as e:
    print("ooops, something very wrong! :(",e)

#2

have overcome this issue now as there was an issue at the receive end.