Metadata-Version: 2.5
Name: smithy-http
Version: 0.9.0
Summary: HTTP components for Smithy tooling.
Project-URL: Changelog, https://github.com/smithy-lang/smithy-python/blob/develop/packages/smithy-http/CHANGELOG.md
Project-URL: Code, https://github.com/smithy-lang/smithy-python/blob/develop/packages/smithy-http/
Project-URL: Issue tracker, https://github.com/smithy-lang/smithy-python/issues
Author: Amazon Web Services
License: Apache License 2.0
License-File: NOTICE
Keywords: http,sdk,smithy
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Requires-Dist: smithy-core~=0.12.0
Provides-Extra: aiohttp
Requires-Dist: aiohttp<4.0,>=3.11.12; extra == 'aiohttp'
Requires-Dist: yarl>=1.17.0; extra == 'aiohttp'
Provides-Extra: awscrt
Requires-Dist: awscrt~=0.32.0; extra == 'awscrt'
Provides-Extra: cbor
Requires-Dist: smithy-cbor~=0.4.0; extra == 'cbor'
Provides-Extra: eventstream
Requires-Dist: smithy-aws-event-stream~=0.6.0; extra == 'eventstream'
Provides-Extra: json
Requires-Dist: smithy-json~=0.6.0; extra == 'json'
Provides-Extra: urllib3
Requires-Dist: urllib3<3.0,>=2.0; extra == 'urllib3'
Description-Content-Type: text/markdown

# 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

```python
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 objects                                                                                                                              
- `MockHTTPClientError`: Exception raised when no responses are queued                                                                                                                               
