I am trying to send a cookie along with my HttpGet request, but everytime I try I havent been able to successfully send it. I also tried to modify the headers directly, here is my code:
DefaultHttpClient httpclient = new DefaultHttpClient();
CookieStore store = new BasicCookieStore();
store.addCookie(Authentication.getCookie());
httpclient.setCookieStore(store);
HttpGet httpget = new HttpGet("http://localhost:8080/Search/);
//httpget.addHeader("Cookie", Authentication.getCookie().toString());
//httpget.addHeader((Header) Authentication.getCookie());
try {
// Execute HTTP Get Request
HttpResponse response = httpclient.execute(httpget);
String responseData = ResponseHandler.getResponseBody(response);
} catch (IOException e) {
e.printStackTrace();
}