Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
header_parameters['X-MSEdge-ClientIP'] = self._serialize.header("client_ip", client_ip, 'str')
if location is not None:
header_parameters['X-Search-Location'] = self._serialize.header("location", location, 'str')
# Construct form data
form_data_content = {
'knowledgeRequest': knowledge_request,
'image': image,
}
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('ImageKnowledge', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
visual_search.metadata = {'url': '/images/visualsearch'}