Skip to content

Commit a619c83

Browse files
committed
docs: Update README and CHANGELOG for Request field renaming
- Added documentation for new Request field names in README - Added clear mapping between Request fields and :httpc.request arguments - Updated CHANGELOG with detailed field renaming information - Enhanced field naming explanation with technical details Documents the improved field naming convention: - : 3rd argument to :httpc.request (request-specific HTTP options) - : 4th argument to :httpc.request (client-specific options)
1 parent 0fd0a4e commit a619c83

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- **URI struct support** - HTTP.fetch/2 now accepts both string URLs and %URI{} structs
1212
- **Enhanced URL handling** - Automatic conversion from string to %URI{} for internal processing
1313
- **Type safety improvements** - HTTP.Request and HTTP.Response now use %URI{} internally
14+
- **Improved Request field naming** - More intuitive field names for :httpc.request mapping
1415

1516
### Changed
1617
- **Refactored URL handling** - All internal representations now use %URI{} instead of string
1718
- **Updated type specifications** - HTTP.Request.url type changed from String.t() | charlist() to URI.t()
1819
- **Updated Response.url type** - Changed from String.t() to URI.t()
1920
- **Updated function signatures** - handle_httpc_response and related functions now accept URI.t()
21+
- **HTTP.Request field renaming** for better clarity:
22+
- `options``http_options` (3rd argument to :httpc.request)
23+
- `opts``options` (4th argument to :httpc.request)
2024

2125
### Technical Details
2226
- **Backward compatibility** - String URLs are automatically parsed to URI structs
2327
- **Consistent URI handling** - All internal operations use parsed URI structs
2428
- **Eliminated redundant parsing** - Removed duplicate URI.parse calls in streaming functions
2529
- **Enhanced type safety** - Stronger typing throughout the codebase
2630
- **Updated test suite** - Request tests updated to use URI.parse/1 for consistency
31+
- **Improved field documentation** - Clear mapping to :httpc.request arguments
2732

2833
## [0.4.0] - 2025-07-30
2934

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,16 @@ request = %HTTP.Request{
106106
method: :post,
107107
url: URI.parse("https://api.example.com/data"),
108108
headers: [{"Authorization", "Bearer token"}],
109-
body: "data"
109+
body: "data",
110+
http_options: [timeout: 10_000, connect_timeout: 5_000],
111+
options: [sync: false, body_format: :binary]
110112
}
111113
```
112114

115+
**Field Mapping to :httpc.request/4:**
116+
- `http_options`: 3rd argument (request-specific HTTP options)
117+
- `options`: 4th argument (client-specific options)
118+
113119
### HTTP.FormData
114120
Handle form data and file uploads.
115121

0 commit comments

Comments
 (0)