HttpEntityContent
Represents an HTTP request or response entity.
The contents of the entity can be accessed using the body
property. If expecting JSON-encoded content, HTML, or XML content, a parsed
representation of the content can be accessed using the json
,
html
, or xml
properties. If there are errors parsing the
content, they are available in the parseError
property.
Introduced in version 4.2.
Properties
-
Document xml
- The
body
as a parsed XML DOM structure. If parsing fails, this property will benull
and any exceptions can be read from theparseError
property. The DOM structure can be interrogated using normal Freemarker XML handling; see the Freemarker documentation ( https://freemarker.apache.org/docs/xgui.html for details. -
Object json
- The
body
as a parsed JSON object. This can also be done manually in Freemarker usingresponse.body?eval
; this property is provided as a convenience. If the parsing of the JSON fails, this property will benull
and any exceptions can be read from theparseError
property. -
Document html
- The
body
as a DOM structure generated by the Jsoup Java library ( https://jsoup.org/ ). If the parsing of the body fails, this property will be null and any exceptions can be read from theparseError
property. -
String base64
- The raw entity encoded as base64 string. This can be used to handle binary data, for example to store a file that includes binary data.