aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes URLConnection how to find the Http Code Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "URLConnection how to find the Http Code" Watch "URLConnection how to find the Http Code" New topic
Author

URLConnection how to find the Http Code

mani vannan
Ranch Hand

Joined: Apr 17, 2006
Posts: 47
Hi, I am using following code sample given in the url http://www.iam.ubc.ca/guides/javatut/networking/urls/readingWriting.html, to read a web page. The server redirects my client. How do I find the HTTP Response code returned by the server?


Mani (SCEA 1.4)<br /><a href="http://excusemeworld.com/technical/is-scjp-useful-worth-helps-job/" target="_blank" rel="nofollow"> Is SCJP Useful? Worth? Helps job?</a>
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8259

your link doesn't work, but you can get the response code from HttpURLConnection.getResponseCode()


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: URLConnection how to find the Http Code
 
Similar Threads
Given a URL, how could I read the html Source code?
This weeks Giveaway
AWT/SWING & Middleware
Problem in Signing the Jar Files
Passing Data Using POST Method without using FORM