Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing Response Headers from the Server!! Help Reqd

Status
Not open for further replies.

luthriaajay

Programmer
Jan 29, 2002
41
FR
Hi,

Can I view the response Headers sent by the Server back to the Client??

It is possible to check the client Headers with the following in your servlet code:

String contentType = request.getContent();
System.out.println(contentType);


How can I check the response headers of the server which it sends back to the client?
If on the server I say : response.setContentType("text/html");
what method I need to invoke on my client to see this content Type???

Please can any one respond..

ajay

ajayluthria@hotmail.com
 
You can view the whole enchilada if you use a raw socket
to make the request.
Connect to on port 80 and do a
GET someResource.html
The stream that comes back will be everything.
 
Hi,

I havent understood what u have replied.
I would like to view the HTTP Response Headers
sent to me by the Server...

PLEASE RESPONd
ajayluthria@hotmail.com
 
You can do this from a java client using the URLConnection class.

URL url = new URL("URLConnection conn = url.openConnection();
...
String header = conn.getHeaderField("Content-Type");

Regards,

Charles
 
THANK YOU VERY MUCH CHARLES......
THUIS HAS REALLY HELPED ME
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top