I am new to async task . I need to use httppost in my application. Please help me to manipulate the following code using async task. Please give me structured code
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("url here");
httpPost.addHeader("Content-Type", "application/xml");
try {
HttpResponse response = httpClient.execute(httpPost);
BufferedReader reader = new BufferedReader(
new InputStreamReader(response.getEntity()
.getContent(), "UTF-8"));
StringBuffer responseString = new StringBuffer("");
String line;
while ((line = reader.readLine()) != null) {
responseString.append(line);
}
System.out.println("respose QQQQQQQQQQQ");
System.out.println("11response "
+ responseString.toString());
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}