Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A minimal HTTP Client, for Requests.

Project description

Experimental lower-level async HTTP client for Requests 3.0


Goals: take urllib3 codebase, add async support (with multiple backends), default to trio execution of async functions for blocking calls.

Usage

Async usage:

import requests_core

url = "http://httpbin.org/uuid"

async def main():
    r = await requests_core.request('GET', url)
    print(r.headers)
    print(await r.read())
>>> import trio
>>> trio.run(main)
    HTTPHeaderDict({'connection': 'keep-alive', 'server': 'meinheld/0.6.1', 'date': 'Fri, 16 Mar 2018 11:59:57 GMT', 'content-type': 'application/json', 'access-control-allow-origin': '*', 'access-control-allow-credentials': 'true', 'x-powered-by': 'Flask', 'x-processed-time': '0', 'content-length': '53', 'via': '1.1 vegur'})
    b'{\n  "uuid": "693947c9-9f49-4b4a-be94-73a152ce1acb"\n}\n'

Sync usage:

>>> r = requests_core.blocking_request('GET', URL)
>>> print()
<requests_core.http_manager._async.response.HTTPResponse object at 0x103f63c88>

Installation

This is a work in progress. Don’t install it.

Project details


Download files

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

Files for requestscore, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size requestscore-0.0.0-py2.py3-none-any.whl (150.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size requestscore-0.0.0.tar.gz (125.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page