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.
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.