I'm trying to convert the following cURL command into a Request in Python.
curl -H 'customheader: value' -H 'customheader2: value' --data "Username=user&UserPassword=pass" https://thisismyurl
From what I understand, one can GET headers and POST data. So how do I do both like a cURL?
This is what I'm trying:
url = 'myurl'
headers = {'customheader': 'value', 'customheader2': 'value'}
data = 'Username=user&UserPassword=pass'
requests.get(url, headers=headers, data=data)
Which returns: HTTPError: HTTP 405: Method Not Allowed
If I use post: MissingArgumentError: HTTP 400: Bad Request