def __init__(self, sender=None, message=""): """Initializer @param body: The body of the message, it is put after the headers @type body: string""" HTTPMessage.__init__(self) self.sender = sender if message: self.parse(message)
def __init__(self, content_type, session_id=None, s_channel_state=0, capabilities_flags=1): HTTPMessage.__init__(self) self.content_type = content_type if session_id is not None: self.add_header("SessionID", session_id) if s_channel_state is not None: self.add_header("SChannelState", s_channel_state) if capabilities_flags is not None: self.add_header("Capabilities-Flags", capabilities_flags)
def __init__(self, body=""): """Initializer @param body: The body of the message, it is put after the headers @type body: string""" HTTPMessage.__init__(self) self.passport = 'Hotmail' self.friendly_name = 'Hotmail' self.body = body self.headers = {'MIME-Version' : '1.0', 'Content-Type' : 'text/plain'}
def __init__(self, to="", frm="", branch="", cseq=0, call_id="", max_forwards=0): HTTPMessage.__init__(self) self.add_header("To", "<msnmsgr:%s>" % to) self.add_header("From", "<msnmsgr:%s>" % frm) if branch: self.add_header("Via", "MSNSLP/1.0/TLP ;branch=%s" % branch) self.add_header("CSeq", str(cseq)) if call_id: self.add_header("Call-ID", call_id) self.add_header("Max-Forwards", str(max_forwards)) # Make the body a SLP Message wih "null" content type self.body = SLPNullBody()