I\'m doing my API REST and I saw that in a lot of examples people use EntityUtils.toString(response)
to get their response
into a String
An HttpEntity
represents the content of the body of an HTTP response. EntityUtils.toString(HttpEntity)
interprets that content as a String
and returns it to you.
If your HTTP response is something like this
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 80
Then the String
returned by EntityUtils.toString(HttpEntity)
will simply contain