Making HTTPS POST requests with basic auth

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
johannesl
Posts: 2
Joined: Thu Apr 30, 2020 11:06 pm
Location: Sweden
Contact:

Making HTTPS POST requests with basic auth

Post by johannesl » Thu Apr 30, 2020 11:43 pm

Hi everyone!
I am fairly new to MicroPython but had great fun tonight playing around with it.

The session resulted in a bit of source code for making HTTP POST requests to SSL URLs with support for Basic Auth and with the data sent as x-www-form-urlencoded. Anyone looking to do the same can find the code here:

https://github.com/46elks/46elks-gettin ... opython.py

Image

Image

xwb
Posts: 14
Joined: Sun Oct 25, 2020 8:33 am

Re: Making HTTPS POST requests with basic auth

Post by xwb » Tue Nov 24, 2020 10:04 am

Dear Johannesl
Thanks very much. This is very helpful. I will try and implement tonight and I will report progress if it is successful.

xwb
Posts: 14
Joined: Sun Oct 25, 2020 8:33 am

Re: Making HTTPS POST requests with basic auth

Post by xwb » Tue Nov 24, 2020 10:15 am

Slight issue:

In line 21 of your code:
TypeError: string indices must be integers, not str


Investigating

johannesl
Posts: 2
Joined: Thu Apr 30, 2020 11:06 pm
Location: Sweden
Contact:

Re: Making HTTPS POST requests with basic auth

Post by johannesl » Sat May 29, 2021 10:51 am

Happy to see this example was helpful! :-)

I just confirmed that the code from the above GitHub link works using the latest MicroPython 1.15.

What MicroPython version and architecture are you using?

Post Reply