【发布时间】:2017-12-01 10:46:58
【问题描述】:
我正在尝试以键值对的格式打印 json 数据,以便我可以在我的 html 模板中呈现它们。
def ecpd(request):
r= requests.get('http://jira.xxx.xxx.com/rest/api/2/issue/key-XXX',auth=HTTPBasicAuth('user','pass'),headers = {'Content-Type' : 'application/json'})
jsonDict = json.loads(r.content)
return HttpResponse(jsonDict['fields'])
作为回应,我只得到“字段”中的键列表。 比如:customfield_10070customfield_10071customfield_10072customfield_10073customfield_13221customfield_10074customfield_13220customfield_10075。 我需要一个 dict 格式的键值对。
【问题讨论】:
-
值是多少?