Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

REST XML client: how to convert http entity to a xml domdocument  RSS feed

 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all.

I receve a response from a REST clientin xml format.

There is a clean and simple way to convert org.​apache.​http.HttpEntity to a org.w3c.dom.Document ?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get an InputStream to read the body via getContent(). Then you'd pass that to the DocumentBuilder.parse method.
 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:You can get an InputStream to read the body via getContent(). Then you'd pass that to the DocumentBuilder.parse method.


solved, thanks for yuor help.

This is the code
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!