Skip to main content

awesome_request

A simple and elegant HTTP client for Python — zero dependencies, pure stdlib.

Installation

pip install awesome_request

Quick Start

import awesome_request as ar

# Simple GET
resp = ar.get("https://httpbin.org/get")
print(resp.status_code)  # 200
print(resp.json)         # parsed JSON body

# GET with query parameters
resp = ar.get("https://httpbin.org/get", params={"page": 1, "limit": 20})

# POST JSON
resp = ar.post(
    "https://httpbin.org/post",
    json_data={"name": "Alice", "age": 30},
)
resp.raise_for_status()  # raises HTTPError if 4xx/5xx
print(resp.json)

# POST form data
resp = ar.post(
    "https://httpbin.org/post",
    data={"username": "alice", "password": "secret"},
)

# PUT / PATCH / DELETE
ar.put("https://httpbin.org/put", json_data={"id": 1, "name": "Bob"})
ar.patch("https://httpbin.org/patch", json_data={"name": "Bob"})
ar.delete("https://httpbin.org/delete")

Sessions

Use a Session to share a base URL and default headers across multiple requests.

from awesome_request import Session

session = Session(base_url="https://api.example.com", timeout=10)
session.headers["Authorization"] = "Bearer YOUR_TOKEN"

users = session.get("/users").json
post  = session.post("/posts", json_data={"title": "Hello"}).json

API Reference

Module-level functions

Function Description
ar.get(url, *, params, headers, timeout) Send GET request
ar.post(url, *, params, headers, data, json_data, timeout) Send POST request
ar.put(url, *, ...) Send PUT request
ar.patch(url, *, ...) Send PATCH request
ar.delete(url, *, params, headers, timeout) Send DELETE request
ar.head(url, *, params, headers, timeout) Send HEAD request
ar.request(method, url, **kwargs) Send any HTTP request

Response object

Attribute / Method Description
.status_code HTTP status code (int)
.ok True if status is 2xx
.text Body decoded as string
.json Body parsed as JSON
.content Raw body bytes
.headers Response headers dict
.url Final URL
.raise_for_status() Raise HTTPError on 4xx/5xx

Session(base_url, headers, timeout)

Persistent session for shared config. Has the same .get(), .post(), .put(), .patch(), .delete(), .head(), and .request() methods as module level.

License

MIT

Metadata

Release files for awesome-request 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awesome-request 0.1.0
File Size Uploaded Provenance
awesome_request-0.1.0.tar.gz 6.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for awesome-request 0.1.0
File Interpreter ABI Platform
awesome_request-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / awesome_request-0.1.0.tar.gz

Download URL awesome_request-0.1.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
17bd58ff6b3c849295c6fcb634658c71f1588ce021f7ad712f921cc2014afff7
BLAKE2b-256 checksum
How to use checksums
9b6251b3777901ed1a245d8996be84a61e6c15c97d29554d03929740b6250f9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.0

Release files / awesome_request-0.1.0-py3-none-any.whl

Download URL awesome_request-0.1.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
beca9d1dd57d29db3a21c8f7f5dcb0febbe99f9f0ba0be34282bcd6b7078aa11
BLAKE2b-256 checksum
How to use checksums
10c9a9979d70fb05dc458be7d15cd4f2147dd1c3677757ce26be7bc40f9cb357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.0

Security for awesome-request 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page