Py学习  »  Python

在python中执行rest api脚本时出错:typeerror:“dict”对象不可调用

sayali.k • 7 年前 • 2329 次点击  

我正在编写使用rest api创建团队的代码,我正在使用python 3.7和pycharm ide。 I followed Microsoft TEAM official documentation 我的python代码:

req = request.POST('https://graph.microsoft.com/beta/teams')
headers = {'content-type': 'application/json'}
payload = {
'template@odata.bind': 
'https://graph.microsoft.com/beta/teamsTemplates/standard',
'displayName': 'My Sample Team',
'description': 'My Sample Team’s Description',
}

但我有以下错误:

TypeError:'dict' object is not callable

我是python新手,我试过在网上搜索,但找不到很多有用的信息。提前谢谢。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/40515
文章 [ 1 ]  |  最新文章 7 年前