summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0332/stanza/response.py
diff options
context:
space:
mode:
authorSangeeth Saravanaraj <sangeeth@riptideio.com>2015-01-28 14:52:15 +0530
committerSangeeth Saravanaraj <sangeeth@riptideio.com>2015-01-28 14:52:15 +0530
commite1f25604ecbf5d6c196080cd8394191c7ea459c9 (patch)
tree8c57cf4dad8f1109e7502f029fd8ad573e5ca9d4 /sleekxmpp/plugins/xep_0332/stanza/response.py
parent0fe057b5c3f462275cf8dbf321c2ebec61de1bfe (diff)
downloadslixmpp-e1f25604ecbf5d6c196080cd8394191c7ea459c9.tar.gz
slixmpp-e1f25604ecbf5d6c196080cd8394191c7ea459c9.tar.bz2
slixmpp-e1f25604ecbf5d6c196080cd8394191c7ea459c9.tar.xz
slixmpp-e1f25604ecbf5d6c196080cd8394191c7ea459c9.zip
Added callbacks, registered stanzas, added features, etc.
Diffstat (limited to 'sleekxmpp/plugins/xep_0332/stanza/response.py')
-rw-r--r--sleekxmpp/plugins/xep_0332/stanza/response.py37
1 files changed, 31 insertions, 6 deletions
diff --git a/sleekxmpp/plugins/xep_0332/stanza/response.py b/sleekxmpp/plugins/xep_0332/stanza/response.py
index 7f8180bb..4dc14344 100644
--- a/sleekxmpp/plugins/xep_0332/stanza/response.py
+++ b/sleekxmpp/plugins/xep_0332/stanza/response.py
@@ -8,14 +8,39 @@
See the file LICENSE for copying permission.
"""
-from sleekxmpp import Iq
-from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin
-from sleekxmpp.plugins.xep_0131.stanza import Headers
+from sleekxmpp.xmlstream import ElementBase
+from sleekxmpp.plugins.xep_0332.stanza import NAMESPACE
class Response(ElementBase):
- pass
+ """
+ When the HTTP Server responds, it does so by sending an `iq` stanza
+ response (type=`result`) back to the client containing the `resp` element.
+ Since response are asynchronous, and since multiple requests may be active
+ at the same time, responses may be returned in a different order than the
+ in which the original requests were made.
-register_stanza_plugin(Iq, Response)
-register_stanza_plugin(Response, Headers)
+ Examples:
+ <iq type='result' from='httpserver@clayster.com' to='httpclient@clayster.com/browser' id='2'>
+ <resp xmlns='urn:xmpp:http' version='1.1' statusCode='200' statusMessage='OK'>
+ <headers xmlns='http://jabber.org/protocol/shim'>
+ <header name='Date'>Fri, 03 May 2013 16:39:54GMT-4</header>
+ <header name='Server'>Clayster</header>
+ <header name='Content-Type'>text/turtle</header>
+ <header name='Content-Length'>...</header>
+ <header name='Connection'>Close</header>
+ </headers>
+ <data>
+ <text>
+ ...
+ </text>
+ </data>
+ </resp>
+ </iq>
+ """
+
+ name = 'response'
+ namespace = NAMESPACE
+ interfaces = set(('statusCode', 'statusMessage', 'version'))
+ plugin_attrib = 'resp'