Skip to content

Conversation

dotdashnotdotsoftware
Copy link
Contributor

Addition of an optional parameter which allows for the consumer to define headers to pass when making a HTTP request

Copy link
Member

@dpgeorge dpgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.

The CPython version of urllib.request.urlopen() doesn't have a headers parameter, instead you put headers in a Request object.

But, this MicroPython version of urllib is already not compatible with CPython's version, eg it has a method argument. So I think it's fair enough to support a headers argument here.

This is an extension to CPython, similar to the `method` argument.

Signed-off-by: Adam Lewis <[email protected]>
@dpgeorge dpgeorge merged commit 96bd01e into micropython:master May 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants