Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URLConnection how to find the Http Code  RSS feed

 
mani vannan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your link doesn't work, but you can get the response code from HttpURLConnection.getResponseCode()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!