"Upgrade Required" (response code 426) when using urequests for an API (MongoDB Data API), likely due to HTTP 1.1+ being required #15112
Unanswered
sgbaird
asked this question in
RP2040 / Pico
Replies: 2 comments
-
See issue micropython/micropython-lib#844 Until there is a permanent fix you could copy/patch your own |
Beta Was this translation helpful? Give feedback.
0 replies
-
The workaround of a patched version (somewhat poor naming on my part as urequests_2.py), but the MongoDB Atlas Data API is now deprecated 🙃. So, two birds with one stone by removing my dependence on the Data API 😅, though I'm sure there are others who require the update. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For the last year or so, I've been using Pico W's to upload data directly to a MongoDB Atlas database using the Atlas Data API; however I recently started getting "426: Upgrade Required" as the response (even with a completely fresh MongoDB Atlas M0 cluster). I verified that I can use the Data API through Python:
However, I get the "Upgrade Required" response mentioned above when running MicroPython on the Pico W. I've tried
v1.2.1
,v1.22.2
, and "latest nightly preview build"1.23.*
. The two stable versions led to the same error, whileurequests
on the nightly preview seems to be broken altogether.The Atlas Data API specs require HTTP 1.1+, and it seems that
urequests
on the Pico W may only support HTTP 1.0 (see also https://forums.raspberrypi.com/viewtopic.php?t=339080). This seems likely based on the issue I'm experiencing. This is urgent for me, since I have tutorials, videos, and class assignments that depend on this approach. I understand that the change happened on MongoDB's side, but I'd really like to find a way to get the Pico W communicating with the MongoDB Atlas Data API again.I have some credentials I've made public for the course (only used for public demo purposes). The following script should be fully self-contained and runnable.
The response used to be:
Now, the response is:
Beta Was this translation helpful? Give feedback.
All reactions