thin wrapper for requests enable websocket
Project description
Copyright (c) 2018 denzow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Description: # wsrequests
thin wrapper for requests enable websocket.
## how to install
```bash
$ pip install wsrequests
```
## how to use
```python
from wsrequests import WsRequests
wsr = WsRequests()
# login django
wsr.get('http://localhost:3000')
wsr.post(
'http://localhost:3000',
data={
'username': 'your name',
'password': 'your password',
'csrfmiddlewaretoken': wsr.cookies['csrftoken'],
'next': '/',
}
)
# connect websocket
wsr.connect('ws://localhost:3000/ws/room')
wsr.send_message({'message': 'ping'})
wsr.receive_message()
wsr.disconnect()
```
Platform: UNKNOWN
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Description: # wsrequests
thin wrapper for requests enable websocket.
## how to install
```bash
$ pip install wsrequests
```
## how to use
```python
from wsrequests import WsRequests
wsr = WsRequests()
# login django
wsr.get('http://localhost:3000')
wsr.post(
'http://localhost:3000',
data={
'username': 'your name',
'password': 'your password',
'csrfmiddlewaretoken': wsr.cookies['csrftoken'],
'next': '/',
}
)
# connect websocket
wsr.connect('ws://localhost:3000/ws/room')
wsr.send_message({'message': 'ping'})
wsr.receive_message()
wsr.disconnect()
```
Platform: UNKNOWN
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wsrequests-0.1.1.tar.gz
(3.2 kB
view details)
File details
Details for the file wsrequests-0.1.1.tar.gz
.
File metadata
- Download URL: wsrequests-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 208c462139d97549a8c338d178ad56f23bb9115ebca1c6a0b97e2f0a67c421fb |
|
MD5 | 886b9e38a0e39fff2ed20b91f4b1a143 |
|
BLAKE2b-256 | 2f2224f5fefd65bd50eaf45d9fab3e71fd733bbc5d2c47c5e1c340fcb0d43c16 |