【发布时间】:2015-09-15 10:16:16
【问题描述】:
我在 django 中写了一个 api:
class TagDomain(PatchOauth2, APIView):
def post(self, request, *arg, **kwargs):
records = request.POST['data']
for record in records:
pass
在本地,我写了一个tagdomain.py:
def tagdomain():
headers = {"Content-type": "application/json"}
url= "http://127.0.0.1:8000/api/domain/tag_domain/"
par={'data':data}
r = requests.post(url,data=json.dumps(par), headers=headers, auth=('name', 'passwd'))
....
当我运行 tagdomain.py 时,request.POST 为空,我如何获取数据?
【问题讨论】:
标签: python django oauth request