adafruit / Adafruit_CircuitPython_PyPortal

CircuitPython driver for Adafruit PyPortal.
MIT License
45 stars 56 forks source link

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

Open ViennaMike opened 1 year ago

ViennaMike commented 1 year ago

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.