3👍
extra
is not a separate argument to the post
method, but rather an catch-all keyword arguments variable. To pass your headers, simply use:
response = self.client.post('/webhook/', data={'input': 'hi'},
content_type='application/json', follow=False,
secure=False, **header)
Also, make sure to include a HTTP_
prefix in your headers list.
Source:stackexchange.com