I've got a bug involving httprequest, which happens sometimes, so I'd like to log HttpGet and HttpPost request's content when that happens.
So, let's say, I create HttpGet like this:
HttpGet g = new HttpGet();
g.setURI(new URI("http://www.google.com"));
g.setHeader("test", "hell yeah");
This is the string representation that I'd like to get:
GET / HTTP/1.1
Host: www.google.com
test: hell yeah
With the post request, I'd also like to get the content string.
What is the easiest way to do it in java for android?
Enumeration
(e.g.Enumeration<String>
) to avoid unwanted IDE errors and make use of generics properly. – Apostolic