Add no-arg close_idle_connections! + document form-body decoding (#1118, #1123, #1137)#1279
Merged
Merged
Conversation
…, #1123, #1137) #1137: add `close_idle_connections!()` (closes the default client's pool) and `close_idle_connections!(client)` overloads, so callers can clear cached connections without owning a Transport. The existing Transport method already closes (not just discards) connections. #1118/#1123: document that `HTTP.queryparams` decodes `application/x-www-form-urlencoded` bodies -- it treats `+` (and `%20`) as space -- so it round-trips the Dict/NamedTuple form encoding `HTTP.post` produces. Adds a server-side "Reading POST form parameters" docs example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1279 +/- ##
==========================================
+ Coverage 84.57% 84.73% +0.16%
==========================================
Files 28 28
Lines 10759 10767 +8
==========================================
+ Hits 9099 9123 +24
+ Misses 1660 1644 -16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1118, #1123, #1137 — three related triage outcomes from the same area, bundled.
#1137 — closing cached connections
The 1.x complaint was that
closeallemptied the pool without closing the connections. In 2.0close_idle_connections!(transport)already closes them — but it required aTransportyou own, with no way to reach the default pool used byHTTP.get/HTTP.post/etc.Adds two overloads:
HTTP.close_idle_connections!()— closes the default client's idle connections (no-op if no request has been made yet)HTTP.close_idle_connections!(client)— closes a specific client's pooland expands the docstring to document all three forms.
#1118 / #1123 — decoding form bodies / getting POST params
These asked for a way to decode
application/x-www-form-urlencodedbodies (#1118) and read POST params easily (#1123). The capability already exists:HTTP.queryparamsdecodes+(and%20) as space, soHTTP.queryparams(String(req.body))parses a form body and round-trips theDict/NamedTupleencodingHTTP.postproduces. The gap was discoverability — this adds a "Reading POST form parameters on the server" example to the client guide.Tests
close_idle_connections!()/(client)clear the pool (idle count → 0).queryparams(String(_form_urlencode(dict))) == dictround-trip, incl.+and%20.http_forms_tests134/134 andhttp_client_transport_tests90/90 locally.🤖 Generated with Claude Code