def get(url, userId, password):
"""Helps in making GET REST calls"""
headers = {}
- headers['Accept'] = 'application/xml'
+ headers["Accept"] = "application/xml"
# Send the GET request
req = requests.get(url, None, headers)
def nonprintpost(url, userId, password, data):
"""Helps in making POST REST calls without outputs"""
headers = {}
- headers['Content-Type'] = 'application/json'
+ headers["Content-Type"] = "application/json"
# headers['Accept']= 'application/xml'
resp = requests.post(url, data.encode(), headers=headers)
print("post request with url " + url)
print("post request with data " + data)
headers = {}
- headers['Content-Type'] = 'application/json'
+ headers["Content-Type"] = "application/json"
# headers['Accept']= 'application/xml'
resp = requests.post(url, data.encode(), headers=headers)