blob: eca0b68c89e9fd83d429702bb68366129315e92a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import json
import httplib2
from testscripts.const import MSB_BASE_URL
full_url = MSB_BASE_URL + '/api/nsd/v1/ns_descriptors'
ud_data = {'userDefinedData': {"key2": "value2"}}
headers = {'content-type': 'application/json', 'accept': 'application/json'}
ca_certs = None
auth_type = "rest_no_auth"
http = httplib2.Http(ca_certs=ca_certs, disable_ssl_certificate_validation=(auth_type == "rest_no_auth"))
http.follow_all_redirects = True
resp, resp_content = http.request(full_url, method="POST", body=json.dumps(ud_data), headers=headers)
resp_status, resp_body = resp['status'], resp_content
print(resp_status, resp_body)
|