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)
어떻게 동기 읽기와 블록이 비어 있지 않은 동안 _ 크기 (덩어리)에 의해이 파일을 넣어 만들 수 있습니까?