mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-10-03 12:00:44 +08:00
Batch API support
This commit is contained in:
1 parent
cc1d6dc502
commit
9ed17b8f34
9 files changed
+27
-47
No files matched your search
@@ -4,8 +4,10 @@ from skimage.transform import resize
|
||||
|
||||
from indicoio import JSON_HEADERS
|
||||
|
||||
def api_handler(arg, url):
|
||||
def api_handler(arg, url, batch=False):
|
||||
data_dict = json.dumps({'data': arg})
|
||||
if batch:
|
||||
url += "/batch"
|
||||
response = requests.post(url, data=data_dict, headers=JSON_HEADERS).json()
|
||||
results = response.get('results', False)
|
||||
if not results:
|
||||
|
||||
Reference in new issue
Block a user