Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Set Request Headers like "User Agent, Host, Connection" in a servlet

843841Aug 30 2006 — edited Sep 2 2006
Hi all,

I have a question regarding servlets.

How can we set the Headers in a Http request that we send FROM a servlet?

For example, a request from a Html Page has the following headers:

"GET / HTTP/1.1
Host: www.yahoo.com
User-Agent: Opera/9.00 (Windows NT 5.1; U; en)
Accept-Encoding: en
Connection: close"

Is it possible to include this header inside a request I send FROM a servlet to a certain URL?

Thanks for any help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2006
Added on Aug 30 2006
6 comments
332 views