我在进行rest调用时遇到问题,它在执行期间引发异常:AttributeError:'unicode'对象没有属性'get'
def get_headers(request):
#CSRF Protection
response = request.get('crumbIssuer/api/json')
if response.isSuccessful():
crumb = JsonPathResult(response.response, 'crumb').get()
return {'Jenkins-Crumb':crumb}
Server = 'https://jenkins.com'
username = user1
password = pwd
request = HttpRequest(Server, username, password)
headers = get_headers(request)
目前没有回答
相关问题 更多 >
编程相关推荐