python代码如下
import requests
url1="http://localhost:8080/pinter/com/getSku?id=1"
respon=requests.get(url1)
print(respon.json()) #获取所有的返回结果
print(respon.json()['data']['skuName'])#只获取返回的skuName值
#第一个接口返回的skuName数据 作为第二个接口userName的入参
url2="http://localhost:8080/pinter/com/register"
data={
"userName":"respon.json()['data']['skuName']",
"password":"",
"gender":0,
"phoneNum":"",
"email":"123456@163.com",
"address":"guangdong",
}
result=requests.post(url2,json=data)
print(result.json())
返回结果如下