python调用接口返回401,带有Python的Jira API在有效凭据上返回错误401

使用Python的Jira库尝试连接到Jira服务器时,即使在不做任何操作的情况下,构造函数也失败并返回401错误。手动在Atlassian上使用相同的凭据可以成功登录。解决方案是使用API令牌替换基本认证中的密码。
摘要由CSDN通过智能技术生成

I am trying to use the Jira python library to do some quite basic things.

Even before doing anything, the constructor fails.

address = 'https://myaddress.atlassian.net'

options = {'server': address}

un = 'my@user.com'

#un = 'my' #also doesn't work

pw = 'the_pasSword!'

cookie = (un, pw)

j = JIRA(options, basic_auth=cookie)

This is ALL the code.

The last line fails with

WARNING:root:Got recoverable error from GET

https://myaddress.atlassian.net/rest/api/2/serverInfo, will retry [1/3]

in 13.906688704524315s. Err: 401

WARNING:root:Got recoverable error

from GET https://myaddress.atlassian.net/rest/api/2/serverInfo, will

retry [2/3] in 4.071181495745648s. Err: 401

WARNING:root:Got</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值