azure-servicebus/azure/servicebus/control_client/models.py
def add_headers(self, request):
        ''' add addtional headers to request for message request.'''

        # Adds custom properties
        if self.custom_properties:
            for name, value in self.custom_properties.items():
                request.headers.append((name, self._serialize_escaped_properties_value(value)))

        # Adds content-type
        request.headers.append(('Content-Type', self.type))

        # Adds BrokerProperties
        if self.broker_properties:
            if hasattr(self.broker_properties, 'items'):
                broker_properties = {name: self._serialize_basic_properties_value(value)
                                     for name, value
                                     in self.broker_properties.items()}
                broker_properties = json.dumps(broker_properties)
            else:
                broker_properties = self.broker_properties
            request.headers.append(
                ('BrokerProperties', str(broker_properties)))

        return request.headers
def add_headers(self, request):
        ''' add addtional headers to request for message request.'''

        # Adds custom properties
        if self.custom_properties:
            for name, value in self.custom_properties.items():
                request.headers.append((name, self._serialize_escaped_properties_value(value)))

        # Adds content-type
        request.headers.append(('Content-Type', self.type))

        # Adds BrokerProperties
        if self.broker_properties:
            if hasattr(self.broker_properties, 'items'):
                broker_properties = {name: self._serialize_basic_properties_value(value)
                                     for name, value
                                     in self.broker_properties.items()}
                broker_properties = json.dumps(broker_properties)
            else:
                broker_properties = self.broker_properties
            request.headers.append(
                ('BrokerProperties', str(broker_properties)))

        return request.headers
def add_headers ( self , request ) : # Adds custom properties if self . custom_properties : for name , value in self . custom_properties . items ( ) : request . headers . append ( ( name , self . _serialize_escaped_properties_value ( value ) ) ) # Adds content-type request . headers . append ( ( 'Content-Type' , self . type ) ) # Adds BrokerProperties if self . broker_properties : if hasattr ( self . broker_properties , 'items' ) : broker_properties = { name : self . _serialize_basic_properties_value ( value ) for name , value in self . broker_properties . items ( ) } broker_properties = json . dumps ( broker_properties ) else : broker_properties = self . broker_properties request . headers . append ( ( 'BrokerProperties' , str ( broker_properties ) ) ) return request . headers
add addtional headers to request for message request.
add addtional headers to request for message request .