pythonrestapidemo_使用python的HP QC REST API

我试图使用python连接HP QC以创建缺陷并附加文件,但我无法连接到HP QC。这是我的代码:domain='DEFAULT_773497139'

project='773497139_DEMO'

import requests

url = "https://almalm1250saastrial.saas.hpe.com/qcbin/"

querystring = {"username":"user@gmail.com","password":"password"}

headers = {

'cache-control': "no-cache",

'token': "5d33d0b7-1d04-4989-3349-3005b847ab7f"

}

response = requests.request("POST", url, headers=headers, params=querystring)

#~ print(response.text)

print response.headers

new_header = response.headers

new_url = url+ u'rest/domains/'+domain+u'/projects/'+project

new_querystring = {

"username":"user@gmail.com",

"password":"password",

"domain":'DEFAULT_773497139',

"project":'773497139_DEMO'

}

print new_url

response = requests.request("POST", new_url, headers=new_header, params=new_querystring)

print(response.text)

现在登录可以正常工作,但是当尝试它要求的其他API时,我会收到以下消息:

^{pr2}$

如果参数已添加,则返回登录页面。在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值