diff options
author | Mike Taylor <bear42@gmail.com> | 2015-05-01 12:50:06 -0400 |
---|---|---|
committer | Mike Taylor <bear42@gmail.com> | 2015-05-01 12:50:06 -0400 |
commit | a8ac115310c1b9aaa80cc0d48a1157396b29abd3 (patch) | |
tree | 8f8cc46e058dda0294d060c94b1b8b98f4725b18 /sleekxmpp/plugins/xep_0332/stanza/request.py | |
parent | 192b7e0349429839261eb4d1d42d8f75933dc0c2 (diff) | |
parent | 1345b7c1d0b3c121471034521e9028cd43569cb7 (diff) | |
download | slixmpp-a8ac115310c1b9aaa80cc0d48a1157396b29abd3.tar.gz slixmpp-a8ac115310c1b9aaa80cc0d48a1157396b29abd3.tar.bz2 slixmpp-a8ac115310c1b9aaa80cc0d48a1157396b29abd3.tar.xz slixmpp-a8ac115310c1b9aaa80cc0d48a1157396b29abd3.zip |
Merge pull request #363 from sangeeths/xep_0332
XEP_332: Prefixed request and response with "http"
Diffstat (limited to 'sleekxmpp/plugins/xep_0332/stanza/request.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0332/stanza/request.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sleekxmpp/plugins/xep_0332/stanza/request.py b/sleekxmpp/plugins/xep_0332/stanza/request.py index 07618727..9a298e57 100644 --- a/sleekxmpp/plugins/xep_0332/stanza/request.py +++ b/sleekxmpp/plugins/xep_0332/stanza/request.py @@ -11,16 +11,19 @@ from sleekxmpp.xmlstream import ElementBase -class Request(ElementBase): +class HTTPRequest(ElementBase): """ All HTTP communication is done using the `Request`/`Response` paradigm. - Each HTTP Request is made sending an `iq` stanza containing a `req` element - to the server. Each `iq` stanza sent is of type `set`. + Each HTTP Request is made sending an `iq` stanza containing a `req` + element to the server. Each `iq` stanza sent is of type `set`. Examples: <iq type='set' from='a@b.com/browser' to='x@y.com' id='1'> - <req xmlns='urn:xmpp:http' method='GET' resource='/api/users' version='1.1'> + <req xmlns='urn:xmpp:http' + method='GET' + resource='/api/users' + version='1.1'> <headers xmlns='http://jabber.org/protocol/shim'> <header name='Host'>b.com</header> </headers> @@ -28,7 +31,10 @@ class Request(ElementBase): </iq> <iq type='set' from='a@b.com/browser' to='x@y.com' id='2'> - <req xmlns='urn:xmpp:http' method='PUT' resource='/api/users' version='1.1'> + <req xmlns='urn:xmpp:http' + method='PUT' + resource='/api/users' + version='1.1'> <headers xmlns='http://jabber.org/protocol/shim'> <header name='Host'>b.com</header> <header name='Content-Type'>text/html</header> @@ -44,7 +50,7 @@ class Request(ElementBase): name = 'request' namespace = 'urn:xmpp:http' interfaces = set(['method', 'resource', 'version']) - plugin_attrib = 'req' + plugin_attrib = 'http-req' def get_method(self): return self._get_attr('method', None) |