adafruit / adafruit/Adafruit_CircuitPython_PyPortal

Feature suggestion: allow new headers to be passed to PyPortal.fetch, just as a new URL can be

Open
#124 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
46
Forks
56
PR merge metrics
No merged PRs in 30d

Description

PyPortal.fetch can be used to get data from different URLs simply by passing a new URL when it is called. However this cannot be done for headers. headers cannot currently be passed in a call to that function. Instead is uses the information, if any, set when the instance of PyPortal was first initialized.

I suggest adding the ability to pass a new header as a named argument in the call, so that different URL's with different headers can be called more easily. I think this would be an easy change. If the parameter is passed in, then it just replaces _headers in the network call.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the PyPortal.fetch implementation and inspect how it obtains headers from the initialized instance. Done means fetch accepts an optional named headers argument for a call, uses it when supplied, and retains the existing behavior when it is omitted; verify calls using different URLs and headers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.