Skip to content

Commit

Permalink
update request
Browse files Browse the repository at this point in the history
  • Loading branch information
stonezdj committed Nov 22, 2018
1 parent e91ce4e commit df2a1af
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/configharbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
auth_values = (user, passwd)
session = requests.Session()
session.verify = False
response = session.put(url, auth=auth_values, json=reqJson)

data = json.dumps(reqJson)
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
response = session.put(url, auth=auth_values, data=data, headers=headers)

# Convert JSON to dict and print
if response.status_code == 200 :
print("Configure setting success")
print("values:"+json.dumps(reqJson))
print("values:"+data)
sys.exit(0)
else:
print("Failed with http return code:"+ str(response.status_code))
Expand Down

0 comments on commit df2a1af

Please sign in to comment.