0

I'm trying to upload a video to my Vimeo account from within a web-app, and the upload part is working, but I can't find a way to include the redirect_url option. In Postman it works, but in python it's just ignored. Here's the snippet:

    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)

After uploading the video (which is successful) it just redirects to the default vimeo page. Tried countless variations, can't figure it out, has anyone done this?

Big Guy
  • 712
  • 1
  • 8
  • 21

1 Answers1

0
'Content-Type': 'text/plain'

this should have been:

'Content-Type': 'application/json'
Big Guy
  • 712
  • 1
  • 8
  • 21