Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. url = "http://example.com/file.csv"
  2. id = "user-id"
  3. password = "password"
  4. headers = {'content-type': 'application/x-www-form-urlencoded'}
  5.  
  6. with open(file_path, 'rb') as f:
  7. response = requests.post(url=url, files={'file':f}, auth=HTTPBasicAuth(username=id, password=password),headers=headers)
  8.  
  9. curl -u user-id:password -T file/path/on/local/machine/file.csv "http://example.com/file.csv"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement