Depending on http post or get you can use getAllHeaders or getHeaders method. Here is an example for http post.
HTTP POST method :
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(URL);
first method :
public Header[] getAllHeaders ()
Added in API level 1
Returns all the headers of this message. Headers are orderd in the sequence they will be sent over a connection.
Returns
all the headers of this message
second method description :
public Header[] getHeaders (String name)
Added in API level 1
Returns all the headers with a specified name of this message. Header values are ignored. Headers are orderd in the sequence they will be sent over a connection.
Parameters
name the name of the headers to return.
Returns
the headers whose name property equals name.
"); }" – ChitranjanThakur Apr 07 '14 at 12:46