1
私は、HTTPソースからファイルを読み込み、別のHTTPソースにPUTリクエストを送る単純なPythonスクリプトを持っています。urllib2.urlopenでチャンクを同期して読み込んで入れよう
block_size = 4096
file = urllib2.urlopen('http://path/to/someting.file').read(block_size)
headers = {'X-Auth-Token': token_id, 'content-type': 'application/octet-stream'}
response = requests.put(url='http://server/path', data=file, headers=headers)
はどのようにして、同期読み取りとブロックが空でない間、BLOCK_SIZE(チャンク)でこのファイルを置くことを行うことができますか?