• 1.17.2

Managing XML Responses

When your HTTP Response contains an XML document, it is convenient to use XmlResponse decorator to manipulate it, for example:

String name = new JdkRequest("http://my.example.com")
  .assertXPath("/data/name") // AssertionError if this XPath is absent
  .xml() // convert HTTP body to com.jcabi.xml.XML

Method XmlResponse#xml() converts HTTP body to an instance of class XML from jcabi-xml project.

Don't forget to add this dependency to your classpath:


Read also about RestResponse, which helps you to manage default HTTP response concepts.