How to use the azure-servicemanagement-legacy.azure.servicemanagement._http.winhttp._WinHttpRequest function in azure-servicemanagement-legacy

To help you get started, we’ve selected a few azure-servicemanagement-legacy 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-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def response_body(self):
        '''
        Gets response body as a SAFEARRAY and converts the SAFEARRAY to str.
        '''
        var_respbody = VARIANT()
        _WinHttpRequest._ResponseBody(self, byref(var_respbody))
        if var_respbody.is_safearray_of_bytes():
            respbody = var_respbody.str_from_safearray()
            return respbody
        else:
            return ''
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def set_tunnel(self, host, port):
        ''' Sets up the host and the port for the HTTP CONNECT Tunnelling.'''
        url = host
        if port:
            url = url + u':' + port

        var_host = VARIANT.create_bstr_from_str(url)
        var_empty = VARIANT.create_empty()

        _WinHttpRequest._SetProxy(
            self, HTTPREQUEST_PROXYSETTING_PROXY, var_host, var_empty)
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def send(self, request=None):
        ''' Sends the request body. '''

        # Sends VT_EMPTY if it is GET, HEAD request.
        if request is None:
            var_empty = VARIANT.create_empty()
            _WinHttpRequest._Send(self, var_empty)
        else:  # Sends request body as SAFEArray.
            _request = VARIANT.create_safearray_from_str(request)
            _WinHttpRequest._Send(self, _request)
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def set_client_certificate(self, certificate):
        '''Sets client certificate for the request. '''
        _certificate = BSTR(certificate)
        _WinHttpRequest._SetClientCertificate(self, _certificate)
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def __init__(self, host, cert_file, protocol, timeout):
        ''' initialize the IWinHttpWebRequest Com Object.'''
        self.host = unicode(host)
        self.cert_file = cert_file
        self._httprequest = _WinHttpRequest()
        self.protocol = protocol.lower()
        self.timeout = timeout
        clsid = GUID('{2087C2F4-2CEF-4953-A8AB-66779B670495}')
        iid = GUID('{016FE2EC-B2C8-45F8-B23B-39E53A75396B}')
        _CoInitialize(None)
        _CoCreateInstance(byref(clsid), 0, 1, byref(iid),
                          byref(self._httprequest))
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def set_proxy_credentials(self, user, password):
        _WinHttpRequest._SetCredentials(
            self, BSTR(user), BSTR(password),
            HTTPREQUEST_SETCREDENTIALS_FOR_PROXY)
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def get_all_response_headers(self):
        ''' Gets back all response headers. '''

        bstr_headers = c_void_p()
        _WinHttpRequest._GetAllResponseHeaders(self, byref(bstr_headers))
        bstr_headers = ctypes.cast(bstr_headers, c_wchar_p)
        headers = bstr_headers.value
        _SysFreeString(bstr_headers)
        return headers
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def status_text(self):
        ''' Gets status text of response. '''

        bstr_status_text = c_void_p()
        _WinHttpRequest._StatusText(self, byref(bstr_status_text))
        bstr_status_text = ctypes.cast(bstr_status_text, c_wchar_p)
        status_text = bstr_status_text.value
        _SysFreeString(bstr_status_text)
        return status_text
github Azure / azure-sdk-for-python / azure-servicemanagement-legacy / azure / servicemanagement / _http / winhttp.py View on Github external
def set_timeout(self, timeout_in_seconds):
        ''' Sets up the timeout for the request. '''
        timeout_in_ms = int(timeout_in_seconds * 1000)
        _WinHttpRequest._SetTimeouts(
            self, 0, timeout_in_ms, timeout_in_ms, timeout_in_ms)

azure-servicemanagement-legacy

Microsoft Azure Legacy Service Management Client Library for Python

MIT
Latest version published 7 days ago

Package Health Score

91 / 100
Full package analysis

Popular azure-servicemanagement-legacy functions