How to use the azure-cognitiveservices-search-visualsearch.azure.cognitiveservices.search.visualsearch.models.ErrorResponseException function in azure-cognitiveservices-search-visualsearch

To help you get started, we’ve selected a few azure-cognitiveservices-search-visualsearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-python / azure-cognitiveservices-search-visualsearch / azure / cognitiveservices / search / visualsearch / operations / images_operations.py View on Github external
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'}

azure-cognitiveservices-search-visualsearch

Microsoft Azure Cognitive Services Visual Search Client Library for Python

MIT
Latest version published 6 years ago

Package Health Score

63 / 100
Full package analysis

Popular azure-cognitiveservices-search-visualsearch functions

Similar packages