-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
What feature should we add?
At the time of writing this issue, the method is defined here:
https://github.com/ethereum/web3.py/blob/main/web3/providers/rpc/rpc.py#L119-L123
It is:
def get_request_headers(self) -> Dict[str, str]:
return {
"Content-Type": "application/json",
"User-Agent": construct_user_agent(str(type(self))),
}I am requesting this method be exposed at the class-level, to be re-written as:
@classmethod
def get_request_headers(cls) -> Dict[str, str]:
return {
"Content-Type": "application/json",
"User-Agent": construct_user_agent(str(cls)),
}Use-case: This allows me to grab the default headers before constructing an HTTPProvider object for the purpose of modifying them / appending to them, without having to redefine.