From b73870d9b644cea381ef17c8e36c249203aea0c6 Mon Sep 17 00:00:00 2001 From: SuperHacker UEFI Date: Fri, 11 Aug 2023 12:34:28 +0800 Subject: [PATCH] Bug Fix for 400 Bad Request I found the 'visualFeatures' should not filled with multiple params, or you will get 400. --- python/ComputerVision/REST/python-disk.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ComputerVision/REST/python-disk.md b/python/ComputerVision/REST/python-disk.md index a194e130..4c59fe61 100644 --- a/python/ComputerVision/REST/python-disk.md +++ b/python/ComputerVision/REST/python-disk.md @@ -60,7 +60,9 @@ image_path = "C:/Documents/ImageToAnalyze.jpg" image_data = open(image_path, "rb").read() headers = {'Ocp-Apim-Subscription-Key': subscription_key, 'Content-Type': 'application/octet-stream'} -params = {'visualFeatures': 'Categories,Description,Color'} +#params = {'visualFeatures': 'Categories,Description,Color'} +# You will recieve 400 Bad Request if you fill multiple features here. +params = {'visualFeatures': 'Description'} response = requests.post( analyze_url, headers=headers, params=params, data=image_data) response.raise_for_status()