Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8588871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:54:34+00:00 2026-06-11T22:54:34+00:00

I am trying to check the status code of any URL in Python using

  • 0

I am trying to check the status code of any URL in Python using the following code

class HeadRequest(urllib2.Request):
    def get_method(self):
        return "HEAD"

when I use it like this:

response = urllib2.urlopen(HeadRequest("http://www.nativeseeds.org/"))

it throws following exception:

HTTPError: HTTP Error 503: Service Temporarily Unavailable

However when I open the above URL “http://www.nativeseeds.org/” in firefox/restclient, it returns 200 status code.

Any help will be highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:54:35+00:00Added an answer on June 11, 2026 at 10:54 pm

    The problem you see has nothing to do with Python. The website itself seems to require something more than just a HEAD request. Even a simple telnet session results in the error:

    $ telnet www.nativeseeds.org 80
    Trying 208.113.230.85...
    Connected to www.nativeseeds.org (208.113.230.85).
    Escape character is '^]'.
    HEAD / HTTP/1.1
    Host: www.nativeseeds.org
    
    HTTP/1.1 503 Service Temporarily Unavailable
    Date: Wed, 26 Sep 2012 14:29:33 GMT
    Server: Apache
    Vary: Accept-Encoding
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    

    Try adding some more headers; the http command line client does get a 200 response:

    $ http -v head http://www.nativeseeds.org
    HEAD / HTTP/1.1
    Host: www.nativeseeds.org
    Content-Type: application/x-www-form-urlencoded; charset=utf-8
    Accept-Encoding: identity, deflate, compress, gzip
    Accept: */*
    User-Agent: HTTPie/0.2.2
    
    HTTP/1.1 200 OK
    Date: Wed, 26 Sep 2012 14:33:21 GMT
    Server: Apache
    P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
    Expires: Mon, 1 Jan 2001 00:00:00 GMT
    Cache-Control: post-check=0, pre-check=0
    Pragma: no-cache
    Set-Cookie: f65129b0cd2c5e10c387f919ac90ad66=34hOijDSzeskKYtULx9V83; path=/
    Last-Modified: Wed, 26 Sep 2012 14:33:23 GMT
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Content-Length: 20
    Content-Type: text/html; charset=utf-8
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a PHP script that will check the HTTP status of
I am trying to check the following and all throw an out of bounds
I'm trying to check a checkbox, i've tried doing the following :- $('#someId').attr('checked','checked'); $('#someId').attr('checked',
I am trying to get my status from facebook using the javascript api. I
I have this function coded to check the status of a Rapidshare link using
I'm creating a class using jsoup that will do the following: The constructor opens
I'm trying to create a web app which will check several service status, server
The url im trying to match is: http://domain/games/getdata/genres/ This request is made via ajax
After trying to append some code to a div layer I received the following
I am trying to check a series of buttons to see if they have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.