in function_app/src/components/content_understanding_client.py [0:0]
def _get_headers(self):
"""Returns the headers for the HTTP requests.
Returns:
dict: A dictionary containing the headers for the HTTP requests.
"""
headers = (
{"Authorization": f"Bearer {self._azure_ad_token_provider()}"}
if self._azure_ad_token_provider
else (
{"Ocp-Apim-Subscription-Key": self._subscription_key}
if self._subscription_key
else {"Authorization": f"Bearer {self._api_token}"}
)
)
headers["x-ms-useragent"] = "cu-sample-code"
if self._enable_face_identification:
headers["cogsvc-videoanalysis-face-identification-enable"] = "true"
return headers