Skip to main content

The Requests like WS module

Project description

RequestsWS

The Requests like WS module

Installation

pip install requestsWS

Usage

Sessions is not documented yet, but it works like requests

import requestsWS

payload = {
    "message": "hello world!"
}
resp = requestsWS.post("wss://localhost:8765", identifiers={"message": "Hi there!"}, json=payload)
print(resp.text)

payload = {
    "method": "server.ping"
}
requestsWS.keepConnection('wss://localhost:8765', interval=20, json=payload)

payload = "hello world"
resp = requestsWS.post("wss://localhost:8765", data=payload)
print(resp.json())

TO DO

  • Multiple connections at once (Use array instead of string), until then use Sessions
  • Add support for identifiers that are deeper into the json
  • Add string support for identifier (Check if identifier in string)
  • Add string support for identifier (Check if identifier in string)
  • Fix timeout

Documentation

Coming soon!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requestsWS-0.0.17.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

requestsWS-0.0.17-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page