You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[bugfix] http-client: honor http:body/@method for inline body serialization
The native EXPath HTTP Client ignored the @method attribute on http:body, so an
inline body could only be XML-serialized or sent as text -- a binary/base64/hex
inline body could not be sent at all (only http:body/@src, added in eXist-db#6510/eXist-db#6511,
delivered raw bytes). RequestBuilder now honors @method (EXPath HTTP Client 3.1):
- binary / base64: the body's content is base64-decoded and sent as raw bytes.
- hex: the content is hex-decoded and sent as raw bytes.
- text: the content's string value is sent (an element child is serialized as
its text, not its markup).
- xml / xhtml / html (or no @method): unchanged -- child elements are
XML-serialized as before.
Malformed base64/hex content raises err:HC005. The string value of body content
is computed by an explicit recursive walk, because the in-memory DOM's
getTextContent does not recurse into element children of a constructed http:body.
Multipart-part @method, JSON/adaptive serialization, and multiple external
$bodies remain follow-ups (eXist-db#6512).
SendRequestFunctionTest gains bodyMethodBinarySendsDecodedBytes,
bodyMethodHexSendsDecodedBytes, and bodyMethodTextSerializesAsText.
Part of eXist-db#6512
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: extensions/modules/http-client/src/test/java/org/exist/xquery/modules/httpclient/SendRequestFunctionTest.java
+50Lines changed: 50 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -816,6 +816,56 @@ public void bodySrcWithoutMediaTypeThrowsHC005() {
816
816
.withStackTraceContaining("HC005");
817
817
}
818
818
819
+
/**
820
+
* http:body/@method='binary' decodes the body's base64 text content and sends the raw bytes
0 commit comments