<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-4924966385028011361.post3427782102731281843..comments</id><updated>2009-07-09T21:52:34.512-07:00</updated><title type='text'>Comments on Mytechtoday.com: Reading the status code of  HTTP Request !</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.mytechtoday.com/feeds/3427782102731281843/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4924966385028011361/3427782102731281843/comments/default'/><link rel='alternate' type='text/html' href='http://www.mytechtoday.com/2009/07/reading-status-code-of-http-request.html'/><author><name>Bishow Paudel</name><uri>http://www.blogger.com/profile/13404171528390907420</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4924966385028011361.post-8363291816213588679</id><published>2009-07-09T21:52:34.512-07:00</published><updated>2009-07-09T21:52:34.512-07:00</updated><title type='text'>You can also use the "responseMessage" property of...</title><content type='html'>You can also use the &amp;quot;responseMessage&amp;quot; property of the connection to get the same kind of information.&lt;br /&gt;&lt;br /&gt;def getUrlResponse(urlString) {&lt;br /&gt;    def conn = new URL(urlString).openConnection()&lt;br /&gt;    &amp;quot;$urlString : ${conn?.responseCode} : ${conn?.responseMessage}&amp;quot;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;println getUrlResponse(&amp;quot;http://google.com&amp;quot;)&lt;br /&gt;// prints http://google.com : 200 : OK&lt;br /&gt;&lt;br /&gt;println getUrlResponse(&amp;quot;http://google.com/foo&amp;quot;) &lt;br /&gt;// prints http://google.com/foo : 404 : Not Found</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4924966385028011361/3427782102731281843/comments/default/8363291816213588679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4924966385028011361/3427782102731281843/comments/default/8363291816213588679'/><link rel='alternate' type='text/html' href='http://www.mytechtoday.com/2009/07/reading-status-code-of-http-request.html?showComment=1247201554512#c8363291816213588679' title=''/><author><name>Ted Naleid</name><uri>http://tednaleid.myopenid.com/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mytechtoday.com/2009/07/reading-status-code-of-http-request.html' ref='tag:blogger.com,1999:blog-4924966385028011361.post-3427782102731281843' source='http://www.blogger.com/feeds/4924966385028011361/posts/default/3427782102731281843' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-4924966385028011361.post-6741080807798487713</id><published>2009-07-09T17:00:51.373-07:00</published><updated>2009-07-09T17:00:51.373-07:00</updated><title type='text'>You are absolutely right ! I have made the correct...</title><content type='html'>You are absolutely right ! I have made the correction on the code.&lt;br /&gt;&lt;br /&gt;Thanks</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4924966385028011361/3427782102731281843/comments/default/6741080807798487713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4924966385028011361/3427782102731281843/comments/default/6741080807798487713'/><link rel='alternate' type='text/html' href='http://www.mytechtoday.com/2009/07/reading-status-code-of-http-request.html?showComment=1247184051373#c6741080807798487713' title=''/><author><name>Bishow Paudel</name><uri>http://www.blogger.com/profile/13404171528390907420</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03962252671399906733'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mytechtoday.com/2009/07/reading-status-code-of-http-request.html' ref='tag:blogger.com,1999:blog-4924966385028011361.post-3427782102731281843' source='http://www.blogger.com/feeds/4924966385028011361/posts/default/3427782102731281843' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-4924966385028011361.post-6989783303569215179</id><published>2009-07-09T15:44:29.377-07:00</published><updated>2009-07-09T15:44:29.377-07:00</updated><title type='text'>You've shown one of the downsides of groovy - poor...</title><content type='html'>You&amp;#39;ve shown one of the downsides of groovy - poor static analysis.&lt;br /&gt;You aren&amp;#39;t using urlString within your checkURL method.&lt;br /&gt;&lt;br /&gt;urlString.toURL() gives you the URL&lt;br /&gt;&lt;br /&gt;URLConnection does not have a getResponseCode() so do you need to explicitly create a HttpURLConnection or does groovy/java automatically know because of the http:// prefix in the URL? In which case why do you have the HttpURLConnection cast in there?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4924966385028011361/3427782102731281843/comments/default/6989783303569215179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4924966385028011361/3427782102731281843/comments/default/6989783303569215179'/><link rel='alternate' type='text/html' href='http://www.mytechtoday.com/2009/07/reading-status-code-of-http-request.html?showComment=1247179469377#c6989783303569215179' title=''/><author><name>Patrick</name><uri>http://www.blogger.com/profile/17880139448719743642</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mytechtoday.com/2009/07/reading-status-code-of-http-request.html' ref='tag:blogger.com,1999:blog-4924966385028011361.post-3427782102731281843' source='http://www.blogger.com/feeds/4924966385028011361/posts/default/3427782102731281843' type='text/html'/></entry></feed>