Error 426 when making GET request



  • Hey,
    I've just received a Core2 and wanted to try making some simple calls to an API. Problem is, I'm getting an error 426 back from the API I'm trying to access. It seems this error is saying my software is too old... I'm using UIFlow 1.7.2-core2 - is this too out of date? Is there a recommendation on what is best to run on my Core2 to get the latest version of MicroPython?

    thanks!



  • @eddible Error 426 is a server response not an API response. It could be that the API calls have changed.



  • Thanks for the reply. You’re right that it’s the server response. In urequests, HTTP/1.0 is hard coded which is why the server returns that error. The API calls haven’t changed, I can make the same requests without issue via other REST clients or using the standard Python requests module. The issue is with the way only HTTP/1.0 is supported.

    What I’m trying to understand is if there is a way to make a request using HTTP/1.1 or above so I can avoid this? I’ve tried just changing it to 1.1 in the urequests module but sadly it doesn’t appear to be that simple!