This is is a single commit on top of #508 which is best reviewed/merged first.
The main result is moving largely duplicate code into a request(...) method.
Further work was saved for later:
move request method onto BaseEndpoint
factor out unnecessary storage of headers e.g. Content-Type which is set when using session.request(..., json=...) - similarly some requests use data=json.dumps(payload) but could just use json=payload
This is is a single commit on top of #508 which is best reviewed/merged first.
The main result is moving largely duplicate code into a
request(...)
method.Further work was saved for later:
BaseEndpoint
session.request(..., json=...)
- similarly some requests usedata=json.dumps(payload)
but could just usejson=payload