GROOVY-11879: A very simple DSL over the JDK's HTTP client#2401
Merged
daniellansun merged 1 commit intoapache:masterfrom Mar 27, 2026
Merged
GROOVY-11879: A very simple DSL over the JDK's HTTP client#2401daniellansun merged 1 commit intoapache:masterfrom
daniellansun merged 1 commit intoapache:masterfrom
Conversation
0d28ec8 to
10b8322
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2401 +/- ##
==================================================
+ Coverage 66.6787% 66.6870% +0.0083%
- Complexity 29858 29895 +37
==================================================
Files 1382 1384 +2
Lines 116145 116297 +152
Branches 20481 20505 +24
==================================================
+ Hits 77444 77555 +111
- Misses 32358 32383 +25
- Partials 6343 6359 +16
🚀 New features to boost your workflow:
|
10b8322 to
042412b
Compare
042412b to
a0b86e0
Compare
061bd44 to
0f4a780
Compare
65c827c to
0d5a457
Compare
0d5a457 to
46b3c44
Compare
Contributor
|
+1 |
Contributor
|
Merged. Thanks. |
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.
groovy-http-builder (incubating)
A small DSL over JDK
java.net.http.HttpClientmaking it more pleasant to use while staying lightweight.Goals
Example
query(...)encodes keys/values as URI query components (RFC 3986 style), e.g. spaces become%20.Non-DSL Equivalent (JDK HttpClient)
JSON
getExampleNon-DSL Equivalent (JDK HttpClient)
JSON
postExampleXML
getExampleHTML
getExample (jsoup)Non-DSL Equivalent (JDK HttpClient + jsoup)
HTML login Example
Form URL-Encoding Helper
This example shows the
formhelper.form(...)encodes values asapplication/x-www-form-urlencodedand setsContent-Typeautomatically (unless you override it withheader).result.parseddispatches by responseContent-Type:application/jsonandapplication/*+json-> JSON objectapplication/xml,text/xml, andapplication/*+xml-> XML objecttext/html-> jsoupDocumentif jsoup is found on the classpath, otherwise raw string bodyTry It
From the repository root: