1

I refer to this.

It seems urllib2.build_opener does not add the document path (/) if the url contains just the domain name. For example a web request to http://ibm.com would result in:

GET http://ibm.com HTTP/1.1

instead of:

GET http://ibm.com/ HTTP/1.1

or:

GET / HTTP/1.1
HOST: ibm.com

as practiced by other Http clients such as web browsers or .NET's HttpWebRequest.

Is this by design or a bug?

Community
  • 1
  • 1
Old Geezer
  • 14,854
  • 31
  • 111
  • 198
  • Have you encountered any web server which doesn't serve the desired page in such a case? – John Zwinck Dec 16 '14 at 09:04
  • The web servers I tried don't mind the missing '/`, but when I go through Fiddler, it flags it as a protocol violation and refuses to continue. – Old Geezer Dec 16 '14 at 09:25

0 Answers0