HTTP components for Smithy tooling.
Project Links
Meta
Author: Amazon Web Services
Requires Python: >=3.12
Classifiers
Development Status
- 2 - Pre-Alpha
Intended Audience
- Developers
- System Administrators
License
- OSI Approved :: Apache Software License
Natural Language
- English
Operating System
- OS Independent
Programming Language
- Python
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Python :: 3.15
- Python :: Free Threading :: 2 - Beta
- Python :: Implementation :: CPython
Topic
- Software Development :: Libraries
smithy-http
This package provides primitives and interfaces for http functionality in tooling generated by Smithy.
Testing
The smithy_http.testing module provides shared utilities for testing HTTP functionality in smithy-python clients.
MockHTTPClient
MockHTTPClient lets you test smithy-python clients without making actual network
calls. It implements the HTTPClient interface and returns queued responses. For async
clients, use smithy_http.aio.testing.AsyncMockHTTPClient, which implements
AsyncHTTPClient the same way.
Basic Usage
from smithy_http.testing import MockHTTPClient
# Create mock client and configure responses
mock_client = MockHTTPClient()
mock_client.add_response(
status=200,
headers=[("Content-Type", "application/json")],
body=b'{"message": "success"}'
)
# Use with your smithy-python client
config = Config(transport=mock_client)
client = TestSmithyServiceClient(config=config)
# Test your client logic
result = client.some_operation({"input": "data"})
# Inspect what requests were made
assert mock_client.call_count == 1
captured_request = mock_client.captured_requests[0]
assert result.message == "success"
Utilities
create_test_request(): Helper for creating test HTTPRequest objectsMockHTTPClientError: Exception raised when no responses are queued
0.10.0
Nov 16, 2026
0.9.0
Nov 13, 2026
0.8.0
Nov 13, 2026
0.7.0
Nov 09, 2026
0.6.0
Oct 08, 2026
0.5.0
Aug 24, 2026
0.4.4
Aug 13, 2026
0.4.3
Jul 31, 2026
0.4.2
Jun 23, 2026
0.4.1
May 21, 2026
0.4.0
Apr 07, 2026
0.3.1
Dec 30, 2025
0.3.0
Nov 21, 2025
0.2.1
Nov 03, 2025
0.2.0
Oct 21, 2025
0.1.0
Sep 29, 2025
0.0.1
Apr 07, 2025