Skip to content

Instantly share code, notes, and snippets.

@pfeodrippe
Created August 28, 2015 00:30
Show Gist options
  • Select an option

  • Save pfeodrippe/b07ad7246ab82bdf95c6 to your computer and use it in GitHub Desktop.

Select an option

Save pfeodrippe/b07ad7246ab82bdf95c6 to your computer and use it in GitHub Desktop.
import time
import requests
from random import randint
while True:
# url = 'http://127.0.0.1:8001/uploadImg'
url = 'http://bioanalyzer.cloudapp.net:81/uploadImg'
init_time = time.time()
folder = str(randint(0,1))
print "\nSent a " + folder
files = {'file': open('_'+ folder +'/'+ str(randint(0,3000)) +'.png', 'rb')}
r = requests.post(url, files=files)
print "Received " + r.text
print "Total time: " + str(time.time() - init_time) + "s"
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment