Say suppose, i want to set a request header for an HttpClient request that i am sending to a URL (it could also be a REST based service), here is how i would go about doing it.
HttpClient client = new HttpClient();
PutMethod method = new PutMethod(
Header head1 = new Header("foo", "f");
method.addRequestHeader(head1);
int statusCode = client.executeMethod(method);
Now, there could be other ways to do this same thing too.. But hey i got a start!
No comments:
Post a Comment