# httpcore

> A minimal low-level HTTP client.

- **URL**: https://www.freshcrate.ai/projects/httpcore
- **Author**: pypi
- **Category**: Frameworks
- **Latest version**: `1.0.9` (2026-04-21)
- **License**: Unknown
- **Source**: https://github.com/encode/httpcore
- **Homepage**: https://pypi.org/project/httpcore/
- **Language**: Python
- **GitHub**: 538 stars, 159 forks
- **Registry**: pypi (`httpcore`)
- **Tags**: `pypi`

## Description

# HTTP Core

[![Test Suite](https://github.com/encode/httpcore/workflows/Test%20Suite/badge.svg)](https://github.com/encode/httpcore/actions)
[![Package version](https://badge.fury.io/py/httpcore.svg)](https://pypi.org/project/httpcore/)

> *Do one thing, and do it well.*

The HTTP Core package provides a minimal low-level HTTP client, which does
one thing only. Sending HTTP requests.

It does not provide any high level model abstractions over the API,
does not handle redirects, multipart uploads, building authentication headers,
transparent HTTP caching, URL parsing, session cookie handling,
content or charset decoding, handling JSON, environment based configuration
defaults, or any of that Jazz.

Some things HTTP Core does do:

* Sending HTTP requests.
* Thread-safe / task-safe connection pooling.
* HTTP(S) proxy & SOCKS proxy support.
* Supports HTTP/1.1 and HTTP/2.
* Provides both sync and async interfaces.
* Async backend support for `asyncio` and `trio`.

## Requirements

Python 3.8+

## Installation

For HTTP/1.1 only support, install with:

```shell
$ pip install httpcore
```

There are also a number of optional extras available...

```shell
$ pip install httpcore['asyncio,trio,http2,socks']
```

## Sending requests

Send an HTTP request:

```python
import httpcore

response = httpcore.request("GET", "https://www.example.com/")

print(response)
# <Response [200]>
print(response.status)
# 200
print(response.headers)
# [(b'Accept-Ranges', b'bytes'), (b'Age', b'557328'), (b'Cache-Control', b'max-age=604800'), ...]
print(response.content)
# b'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>\n\n<meta charset="utf-8"/>\n ...'
```

The top-level `httpcore.request()` function is provided for convenience. In practice whenever you're working with `httpcore` you'll want to use the connection pooling functionality that it provides.

```python
import httpcore

http = httpcore.ConnectionPool()
response = http.request("GET", "https://www.example.com/")
```

Once you're ready to get going, [head over to the documentation](https://www.encode.io/httpcore/).

## Motivation

You *probably* don't want to be using HTTP Core directly. It might make sense if
you're writing something like a proxy service in Python, and you just want
something at the lowest possible level, but more typically you'll want to use
a higher level client library, such as `httpx`.

The motivation for `httpcore` is:

* To provide a reusable low-level client library, that other packages can then build on top of.
* To provide a *really clear interface split* between the networking code and client logic,
  so that each is easier to understand and reason about in isolation.

## Dependencies

The `httpcore` package has the following dependencies...

* `h11`
* `certifi`

And the following optional extras...

* `anyio` - Required by `pip install httpcore['asyncio']`.
* `trio` - Required by `pip install httpcore['trio']`.
* `h2` - Required by `pip install httpcore['http2']`.
* `socksio` - Required by `pip install httpcore['socks']`.

## Versioning

We use [SEMVER for our versioning policy](https://semver.org/).

For changes between package versions please see our [project changelog](CHANGELOG.md).

We recommend pinning your requirements either the most current major version, or a more specific version range:

```python
pip install 'httpcore==1.*'
```
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Version 1.0.9 (April 24th, 2025)

- Resolve https://github.com/advisories/GHSA-vqfr-h8mv-ghfj with h11 dependency update. (#1008)

## Version 1.0.8 (April 11th, 2025)

- Fix `AttributeError` when importing on Python 3.14. (#1005)

## Version 1.0.7 (November 15th, 2024)

- Support `proxy=…` configuration on `ConnectionPool()`. (#974)

## Version 1.0.6 (October 1st, 2024)

- Relax `trio` dependency pinning. (#956)
- Handle `trio` raising `NotImplementedError` on unsupported platforms. (#955)
- Handle mapping `ssl.SSLError` to `httpcore.ConnectError`. (#918)

## 1.0.5 (March 27th, 2024)

- Handle `EndOfStream` exception for anyio backend. (#899)
- Allow trio `0.25.*` series in package dependancies. (#903)

## 1.0.4 (February 21st, 2024)

- Add `target` request extension. (#888)
- Fix support for connection `Upgrade` and `CONNECT` when some data in the stream has been read. (#882)

## 1.0.3 (February 13th, 2024)

- Fix support for async cancellations. (#880)
- Fix trace extension when used with socks proxy. (#849)
- Fix SSL context for connections using the "wss" scheme (#869)

## 1.0.2 (November 10th, 2023)

- Fix `float("inf")` timeouts in `Event.wait` function. (#846)

## 1.0.1 (November 3rd, 2023)

- Fix pool timeout to account for the total time spent retrying. (#823)
- Raise a neater RuntimeError when the correct async deps are not installed. (#826)
- Add support for synchronous TLS-in-TLS streams. (#840)

## 1.0.0 (October 6th, 2

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `1.0.9` | 2026-04-21 | Low | Imported from PyPI (1.0.9) |
| `1.0.8` | 2025-04-11 | Low | ## Version 1.0.8 (April 11th, 2025)  - Fix `AttributeError` when importing on Python 3.14. (#1005) |
| `1.0.7` | 2024-11-15 | Low | ## Version 1.0.7 (November 15th, 2024)  - Support `proxy=…` configuration on `ConnectionPool()`. (#974) |
| `1.0.6` | 2024-10-01 | Low | ## Version 1.0.6 (October 1st, 2024)  - Relax `trio` dependency pinning. (#956) - Handle `trio` raising `NotImplementedError` on unsupported platforms. (#955) - Handle mapping `ssl.SSLError` to `httpcore.ConnectError`. (#918) |
| `1.0.5` | 2024-03-27 | Low | ## 1.0.5 (March 27th, 2024)  - Handle `EndOfStream` for anyio backend. (https://github.com/encode/httpcore/pull/899) - Allow trio `0.25.*` series in package dependancies. (https://github.com/encode/httpcore/pull/903) |
| `1.0.4` | 2024-02-21 | Low | ## 1.0.4 (February 21st, 2024)  - Add `target` request extension. (#888) - Fix support for connection `Upgrade` and `CONNECT` when some data in the stream has been read. (#882) |
| `1.0.3` | 2024-02-14 | Low | ## 1.0.3 (February 13th, 2024)  - Fix support for async cancellations. (#880) - Fix trace extension when used with socks proxy. (#849) - Fix SSL context for connections using the "wss" scheme (#869) |
| `1.0.2` | 2023-11-10 | Low | ## 1.0.2 (November 10th, 2023)   - Fix `float("inf")` timeouts in `Event.wait` function. (#846) |
| `1.0.1` | 2023-11-03 | Low | ## 1.0.1 (November 3rd, 2023)  - Fix pool timeout to account for the total time spent retrying. (#823) - Raise a neater RuntimeError when the correct async deps are not installed. (#826) - Add support for synchronous TLS-in-TLS streams. (#840) |
| `1.0.0` | 2023-10-06 | Low | ## 1.0.0 (6th Oct 2023)  From version 1.0 our async support is now optional, as the package has minimal dependencies by default.  For async support use either `pip install 'httpcore[asyncio]'` or `pip install 'httpcore[trio]'`.  The project versioning policy is now explicitly governed by SEMVER. See https://semver.org/.  - Async support becomes fully optional. (#809) - Add support for Python 3.12. (#807) |

## Citation

- HTML: https://www.freshcrate.ai/projects/httpcore
- Markdown: https://www.freshcrate.ai/projects/httpcore.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/httpcore/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
