Guest User

Untitled

a guest
May 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import requests
  2.  
  3. img_url = "http://site.com/image1337.jpg"
  4.  
  5. # как получить?
  6. img_cached = ???
  7.  
  8. headers = {
  9. 'Accept': 'application/json',
  10. }
  11.  
  12. files = {
  13. # подготовить полученное изображение к отправке
  14. 'img': ('some_img.jpg', img_cached),
  15. }
  16.  
  17. response = requests.post('https://example.com/api/',headers=headers, files=files, auth=('login', 'password'))
Add Comment
Please, Sign In to add comment