3.2 post请求

Request定义好 ,对请求的url进行赋值,对请求的body赋值后就可以进行post请求

host = 'uc-bts.qa.web.sdp.101.com'

uri = '/v0.1/applys'

nonce_mac = getMacAuthorization('POST',uri,host,mac_key)

Authorization = 'MAC id="'+access_token+'",'+nonce_mac

url = 'http://'+host+uri

headers = [NVPair("Authorization",Authorization),NVPair("Content-Type","application/json")]

json_str = '{"role_id":"1","app_id":"2","source_app_id":"'+randomOccurrence(appid)+'"}'

result = request1.POST(url,json_str,headers)

results matching ""

    No results matching ""