pywreck¶
A compact HTTP/1.1 client that’s “good enough” for many cases. The code has no dependencies, is a single source file, and implements no advanced parsing or error handling. For more detailed parameter descriptions, see the API Reference page.
Quickstart¶
Install¶
pip install pywreck
Usage¶
Lowercased HTTP methods are available for use directly on the pywreck
module.
Additionally, pywreck.request()
is provided for custom HTTP methods.
response = await pywreck.get("www.example.com", "/")
print(response.status, response.headers, response.data)
Reusing Connections¶
Creating TCP connections and negotiating TLS can sometimes be expensive. An API is provided to allow for multiple HTTP requests on the same connection.
async with await pywreck.Connection.create("www.example.com") as conn:
for _ in range(2):
response = await conn.request("HEAD", "/")
print(response)