To see the status code from server

You might have seen 404 error while accessing some webstie. It is the status given by the server. The status number will be one among 1,2,3,4,5 ie.. 1XX, 2XX,3XX,4XX,5XX.
depending on the condition, the server show the status number…:-)

sample code below in ruby

require ‘open-uri’

placekitten = open(‘http://placekitten.com/‘) //opens the website

puts placekitten.status // this tells the status of the webste….

complete list of status code form wiki http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s