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 467497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:35:14+00:00 2026-05-12T23:35:14+00:00

if theurl.startswith(http://): theurl = theurl[7:] head = theurl[:theurl.find(‘/’)] tail = theurl[theurl.find(‘/’):] response_code = 0

  • 0
if theurl.startswith("http://"): theurl = theurl[7:]
    head = theurl[:theurl.find('/')]
    tail = theurl[theurl.find('/'):]
response_code = 0
import httplib
conn = httplib.HTTPConnection(head)
conn.request("HEAD",tail)
res = conn.getresponse()
response_code = int(res.status)

http://www.garageband.com/mp3cat/.UZCKbS6N4qk/01_Saraenglish.mp3
Traceback (most recent call last):
  File "check_data_404.py", line 51, in <module>
    run()
  File "check_data_404.py", line 35, in run
    res = conn.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 950, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 390, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 354, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine

Does anyone know what “Bad Status Line” is?

Edit: I tried this for many servers, and many URL’s and I still get this error?

  • 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-05-12T23:35:15+00:00Added an answer on May 12, 2026 at 11:35 pm

    From the documentation for httplib (Python 2) (called http.client in Python 3):

    exception httplib.BadStatusLine: (exception http.client.BadStatusLine🙂

    A subclass of HTTPException.

    Raised if a server responds with an HTTP status code that we don’t understand.

    I ran the same code and did not receive an error:

    >>> theurl = 'http://www.garageband.com/mp3cat/.UZCKbS6N4qk/01_Saraenglish.mp3'
    >>> if theurl.startswith("http://"):
    ...     theurl = theurl[7:]
    ...     head = theurl[:theurl.find('/')]
    ...     tail = theurl[theurl.find('/'):]
    ... 
    >>> head
    'www.garageband.com'
    >>> tail
    '/mp3cat/.UZCKbS6N4qk/01_Saraenglish.mp3'
    >>> response_code = 0
    >>> import httplib
    >>> conn = httplib.HTTPConnection(head)
    >>> conn.request("HEAD", tail)
    >>> res = conn.getresponse()
    >>> res.status
    302
    >>> response_code = int(res.status)
    

    I guess just double-check everything and try again?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import httplib def httpCode(theurl): if theurl.startswith(http://): theurl = theurl[7:] head = theurl[:theurl.find('/')] tail =
I have a variable like var theUrl = 'http://www.google.com/?q=%s'; then i have a input
meaning is there a difference between <WebService(Namespace:=http://theurl.com/)> and <WebService(Namespace:=http://www.theurl.com/)> ?
var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/ if (tomatch.test(theurl)) { window.alert(URL OK.); return true; } I tried this
The URL http://www.fourmilab.ch/cgi-bin/Earth shows a live map of the Earth. If I issue this
the url is http://127.0.0.1:8000/maps/map/wwww/ ' how to get the last word thanks
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
I want to replace calls like this: www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com with: www.mysite.com/sub/param1/param2 Param 1 is an
Found this official ACS demo http://www.fabrikamshipping.com/ while researching on ACS. In the app itself,
I'm trying to make a connection pool following this link: http://192.9.162.55/developer/onlineTraining/Programming/JDCBook/conpool.html I don't understand

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.