':return: A dict that represents the current object and is serializable
by the json or msgpack modules.'

def to_dict(self):

    serializable_dict = {}
    sdict = serializable_dict
    (sdict['code'], sdict['msg'], sdict['headers']) = (self.get_code(), self.get_msg(), dict(self.get_headers()))
    (sdict['body'], sdict['time'], sdict['id']) = (self.get_body(), self.get_wait_time(), self.get_id())
    sdict['uri'] = self.get_uri().url_string
    return serializable_dict
