我正在尝试从网络应用程序中将视频上传到我的Vimeo帐户,并且上传部分可以正常工作,但是我找不到包含redirect_url
选项的方法。在Postman中它可以工作,但是在python中,它只是被忽略了。这是代码段:
def get(self, request):
url = "https://api.vimeo.com/me/videos"
payload = '{ "upload": { "approach": "post", "redirect_url": "www.example.com" }}'
headers = {
'Authorization': 'Bearer <access_token>',
'Content-Type': 'text/plain',
'redirect_url': 'www.example.com'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text.encode('utf8'))
return Response(data=upload_data)
上传视频后(成功),它仅重定向到默认的vimeo页面。尝试了无数种变体,无法弄清楚,有人做过吗?
'Content-Type': 'text/plain'
应该是:
'Content-Type': 'application/json'