I am trying to generate an oauth_signature for an API call. Using Postman, I have generated the code as follows
import requests
import json
url = "https://xxxxxxxxxxxx"
payload = json.dumps({
"key1": "value",
"Key2": "value2"
})
headers = {
'Authorization': 'OAuth realm="xxxxxxxx",
oauth_consumer_key="xxxxxxxxxxxxxxx",
oauth_token="xxxxxxxxxxxx",
oauth_signature_method="HMAC-SHA256",
oauth_timestamp="1628552790",
oauth_nonce="xxxxxxxx",
oauth_version="1.0",
oauth_signature="xxxxxxxxxxxxxxx"',
'Content-Type': 'application/json',
'Cookie': 'NS_ROUTING_VERSION=LAGGING'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
I want to use Python to generate the oauth_signature as Postman generates this auomatically without much documentation as to how