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.16.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

requestsWS-0.0.16-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file requestsWS-0.0.16.tar.gz.

File metadata

  • Download URL: requestsWS-0.0.16.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for requestsWS-0.0.16.tar.gz
Algorithm Hash digest
SHA256 21c31382b628608e6c4257564b46f43a9dd4a81b088369b3f4bb3bcbb1aea601
MD5 a5e878c51ba3abd168d2772f4371aed4
BLAKE2b-256 da3b0228eeb255cda961f83b9a737ba54e8b1ffd4ab77b578c345378fd348bdf

See more details on using hashes here.

File details

Details for the file requestsWS-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: requestsWS-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for requestsWS-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 dbf5c1a228b0cd589db8a3cf60196c61c79dc3e281ad8c9633750e6a7de13b46
MD5 d3f0610088b25ca0bdd13941c76171e8
BLAKE2b-256 1b736429932e22bf46544012284a89e070ac347ca4d9a91d650725d6b33f3f93

See more details on using hashes here.

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