urequests formatting & urlencoding #11311
Unanswered
theseant
asked this question in
RP2040 / Pico
Replies: 2 comments 4 replies
-
Maybe it's better to send the JSON as |
Beta Was this translation helpful? Give feedback.
3 replies
-
Is your Python code sending the client credentials via JSON or parameters in the post body, or via the HTTP headers? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have functioning python code to request data from the husqvarna api. I have tried to recreate this fucntionality in micropython on the Pi Pico with a view to making a display that gives the current status of a husqvarna automower. However, I cannot work out how to format the urequests.post.
I found a really useful topic in the archive (https://forum.micropython.org/viewtopic.php?t=8802) and using the advice from @jimmo, I seem to have almpost solved the problem. The request is sent but the api returns an error
There still seems to be an error in the formatting so that the api does not recognise the client_details.
My micropython code:
The console output is
Printing data=url_escape(ujson.dumps(parameters)) to the consolegives (scerets obscured):
Any advice would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions