Skip to content

Instantly share code, notes, and snippets.

@twymer
Created May 18, 2014 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twymer/69959c468f091a5471b9 to your computer and use it in GitHub Desktop.
Save twymer/69959c468f091a5471b9 to your computer and use it in GitHub Desktop.
packed_directory = {}
for root, dirs, files in os.walk(directory):
for f in files:
relative_path = os.path.join(test_dir_name, f)
packed_directory[relative_path] = open(os.path.join(root, f), 'rb')
r = requests.post(
url=URL,
auth=HTTPDigestAuth('user', 'password'),
files=files,
data={
'foo': 'bar',
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment