Skip to main content

The http client implementation for the fuwa eco-system

Project description

Fuwa HTTP

The HTTP client implementation for the fuwa eco-system

Example

import asyncio

from fuwa.fhttp.client import HTTPClient


async def main():
    client = HTTPClient("bot token")
    await client.init() # calls the application info endpoint
    # this is necessary for most endpoints (such as application command
    # related endpoints)

    payload = [
        {
            "type": 1,
            "name": "hello",
            "description": "Hello, World!"
        }
    ]
    await client.bulk_upsert_application_commands(payload, guild_id=942837947315662859)
    await client.close()
    
asyncio.run(main())

You may think this is quite verbose for a HTTP client, however, the fuwa eco-system doesn't expect you to usue this on its own. This package is used heavily within the command-framework. The package import (from fuwa.fhttp) is fhttp due to the http python standard library. This is to avoid any shadowing issues internally and for you.

Currently, the HTTPClient includes only 2 pre-built methods. These are very basic methods for slash commands. More will be 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

fuwa-http-1.0.2a0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fuwa_http-1.0.2a0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file fuwa-http-1.0.2a0.tar.gz.

File metadata

  • Download URL: fuwa-http-1.0.2a0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.56.0 importlib-metadata/4.6.0 keyring/22.3.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for fuwa-http-1.0.2a0.tar.gz
Algorithm Hash digest
SHA256 d65c2a41bd2f5c0183f0b7a1dd71bd09001d83ed2342d3139ca80985887fb573
MD5 3f39459fc1d35a3aa33e6588e73b3b9c
BLAKE2b-256 68a1bb08d14ac6c14e5b35dc0420ee7192a236ab2bc786748d00a389c93031fa

See more details on using hashes here.

File details

Details for the file fuwa_http-1.0.2a0-py3-none-any.whl.

File metadata

  • Download URL: fuwa_http-1.0.2a0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.56.0 importlib-metadata/4.6.0 keyring/22.3.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for fuwa_http-1.0.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 158a46db535f0beb24de7c0e5b3f22fe14721f594dddd35309e17e34bbb8e082
MD5 d5cb1c53b261ef5b36a63f1e731eba67
BLAKE2b-256 aeff6613c38e91b4fc19c9928641cd7a5023c8ab1d3383282b8b2da3de7281c9

See more details on using hashes here.

Supported by

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