Media uploads

media.upload(server_url, media, *, username='', password='', oauth={})

Uploads media to server and returns attachment URL and file URL.

Parameters:
  • server_url (str) – URL of the server
  • media – a file like stream of bytes to upload
  • username (str) – (optional) name of the authenticating user
  • password (str) – (optional) password of the authenticating user
  • oauth (dict) – (optional) OAuth dict
Return type:

tuple

Returns:

tuple with attachment URL and file URL respectively