Skip to main content

Python bindings for https://github.com/epsilonr/httpclient

Project description

Recuests

Python bindings for my HTTP client as its name implies it have requests like interface.

Struct of Response

class Response:
    def __init__(self, body: str, status: int, headers: dict):
        self.body = body
        self.headers = headers
        self.status = status

    def json(self) -> dict:
        return json.loads(self.body)

    def __str__(self) -> str:
        return self.body

    def __repr__(self) -> str:
        return f"<Response {self.status}>"

Methods

def get(url: str, headers: Optional[Dict[str, str]] = None) -> Response:

def post(url: str, headers: Optional[Dict[str, str]] = None, data: str = "") -> Response:

def put(url: str, headers: Optional[Dict[str, str]] = None, data: str = "") -> Response:

def delete(url: str, headers: Optional[Dict[str, str]] = None) -> Response:

Requirements

  • Precompiled binaries only for linux (yet you can still generate yours with make)
  • Only tested with python 3.11

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

recuests-1.0.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file recuests-1.0.tar.gz.

File metadata

  • Download URL: recuests-1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for recuests-1.0.tar.gz
Algorithm Hash digest
SHA256 d1a50931bf4ee923c74908e328e833258ec23869060923e69c8dae5dbc75ecd9
MD5 50057ab530132d96e7be0886bc720dcf
BLAKE2b-256 0e60ce711cf7666fb473863aea08cc054418084b4c4ebc90f48341b0d6e079dd

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