Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. filepath = 'yourfilename.txt'
  2. with open(filepath) as fh:
  3. mydata = fh.read()
  4. response = requests.put('https://api.elasticemail.com/attachments/upload',
  5. data=mydata,
  6. auth=('omer', 'b01ad0ce'),
  7. headers={'content-type':'text/plain'},
  8. params={'file': filepath}
  9. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement