sharon3874
Programmer
I want to use Apache's HttpClient to send http request header. Can anyone take a look into my code and see if it is correct? (I am using msn's web site for testing purpose)
String url = "HttpClient client = new HttpClient();
GetMethod get = new GetMethod(url);
String etranAuthStr2 = "test";
get.setRequestHeader("CT_REMOTE_USER", "SXYANGET");
get.setRequestHeader("ETRANAUTH", etranAuthStr2);
client.executeMethod(get);
response.getWriter().print(get.getResponseBodyAsString().toString());
I use a debugging tool called "Fiddler" to see the request headers being sent, and looks like the headers are not sending over. did I miss anything? anyone has any idea?
String url = "HttpClient client = new HttpClient();
GetMethod get = new GetMethod(url);
String etranAuthStr2 = "test";
get.setRequestHeader("CT_REMOTE_USER", "SXYANGET");
get.setRequestHeader("ETRANAUTH", etranAuthStr2);
client.executeMethod(get);
response.getWriter().print(get.getResponseBodyAsString().toString());
I use a debugging tool called "Fiddler" to see the request headers being sent, and looks like the headers are not sending over. did I miss anything? anyone has any idea?