'add addtional headers to request for message request.'

def add_headers(self, request):

    if self.custom_properties:
        for (name, value) in self.custom_properties.items():
            request.headers.append((name, self._serialize_escaped_properties_value(value)))
    request.headers.append(('Content-Type', self.type))
    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
