From b8f178ba25496cc8b3297628e159879065651014 Mon Sep 17 00:00:00 2001 From: Coder4 Date: Fri, 15 Feb 2019 17:40:29 +0800 Subject: [PATCH] Add stream flag to avoid Memory Error If not add stream flag, large file will be total load into memory, which cause MemoryError on small RAM server. --- do_http_get.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/do_http_get.py b/do_http_get.py index 97613fa..0fd42f6 100644 --- a/do_http_get.py +++ b/do_http_get.py @@ -6,6 +6,6 @@ def do_get(url, access_token): 'Accept': 'application/json', 'Authorization': 'Bearer {0}'.format(access_token)} - response = requests.get(url, params=None, headers=bearer_headers) + response = requests.get(url, params=None, headers=bearer_headers, stream=True) return response