splunk-sdk-python
splunk-sdk-python copied to clipboard
HttpLib#request has strange argument names
If you look at how Context#request calls HttpLib#request it looks like this:
return self.http.request(
self.url(path), {
'method': message.get("method", "GET"),
'headers': message.get("headers", []) + self._headers(),
'body': message.get("body", "")})
But if you look at the signature for HttpLib#request:
def request(self, url, headers=None, **kwargs):
And in turn when that calls the Handler#request the signature is:
def request(url, message, **kwargs):
Why is the second argument of HttpLib#request named headers when it's clearly the message argument later?
Good catch, that seems clearly wrong.
Name fixed. We were passing the message through the incorrectly named headers param. Name was a leftover from a previous design iteration.