code: def publish(self, body, routing_key, exchange='amq.default',
                  virtual_host='/', properties=None, payload_encoding='string'):
          
          exchange = quote(exchange, '')
          properties = properties or {}
          body = json.dumps(
              {
                  'routing_key': routing_key,
                  'payload': body,
                  'payload_encoding': payload_encoding,
                  'properties': properties,
                  'vhost': virtual_host
              }
          )
          virtual_host = quote(virtual_host, '')
          return self.http_client.post(API_BASIC_PUBLISH %
                                       (
                                           virtual_host,
                                           exchange),
                                       payload=body)
docs: Publish a Message.
  
          :param bytes|str|unicode body: Message payload
          :param str routing_key: Message routing key
          :param str exchange: The exchange to publish the message to
          :param str virtual_host: Virtual host name
          :param dict properties: Message properties
          :param str payload_encoding: Payload encoding.
  
          :raises ApiError: Raises if the remote server encountered an error.
          :raises ApiConnectionError: Raises if there was a connectivity issue.
  
          :rtype: dict