This repository has been archived on 2023-06-09. You can view files and clone it, but cannot push or open issues or pull requests.
jarvis-client/jarvis/utils/server_utils.py

18 lines
582 B
Python

import requests
from requests.structures import CaseInsensitiveDict
def send_record_to_server(frame_data):
# TODO: use config or even ping to find the server on local network ?
url_service = "http://192.168.1.12:5000" + "/process_audio_request"
headers = CaseInsensitiveDict()
headers["Content-Type"] = "text/xml; charset=utf8"
# headers["Authorization"] = config_utils.get_in_config("API_KEY")
response = requests.post(url_service,
headers=headers,
data=frame_data)
print(response.content)