import requests # URL of your Flask app (assuming it's running on localhost on the default port 5000) BASE_URL = "http://192.168.10.217:8888/search_amazon" def test_search_amazon(): # Data to be sent to the API data = { 'site_name': 'us', 'search_key': 'asin', 'search_value': 'B0CNK1ZV8V', 'top_k': '100' } # If you need to send a file # files = {'file': open('path_to_file.jpg', 'rb')} # Making a POST request response = requests.post(BASE_URL, data=data) # If sending file, add , files=files print(response.status_code) print(response.json()) if __name__ == "__main__": test_search_amazon()