HTTP request uses full URL, should be path only

Possibly related to #174: these are links that work just fine in a browser or `curl`/`wget`, but `requests` seems to have trouble with them:
- http://www.rankingz.com
- http://my.jibecompany.com

Example:

```
>>> import requests
>>> requests.get('http://www.rankingz.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pennersr/src/ep/opt/python2.6/src/requests/requests/api.py", line 78, in get
    return request('get', url, **kwargs)
  File "/Users/pennersr/src/ep/opt/python2.6/src/requests/requests/api.py", line 65, in request
    prefetch=prefetch
  File "/Users/pennersr/src/ep/opt/python2.6/src/requests/requests/sessions.py", line 187, in request
    r.send(prefetch=prefetch)
  File "/Users/pennersr/src/ep/opt/python2.6/src/requests/requests/models.py", line 432, in send
    self._build_response(r)
  File "/Users/pennersr/src/ep/opt/python2.6/src/requests/requests/models.py", line 245, in _build_response
    request.send()
  File "/Users/pennersr/src/ep/opt/python2.6/src/requests/requests/models.py", line 424, in send
    raise ConnectionError(e)
requests.exceptions.ConnectionError: Max retries exceeded for url: http://www.rankingz.comhttp/www.rankingz.com
```

Examining the HTTP headers reveals...:

```
GET http://www.rankingz.com HTTP/1.1
Host: www.rankingz.com
Accept-Encoding: identity, deflate, compress, gzip
Accept: */*
User-Agent: python-requests/0.8.0

HTTP/1.1 301 Moved Permanently
Server: Apache
X-Powered-By: PHP/5.3.2-1ubuntu4.10
X-Pingback: http://www.rankingz.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Last-Modified: Mon, 14 Nov 2011 14:20:48 GMT
Cache-Control: public
Pragma: no-cache
Location: http://www.rankingz.comhttp/www.rankingz.com
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html; charset=UTF-8
Content-Length: 20
Date: Mon, 14 Nov 2011 14:20:48 GMT
X-Varnish: 875757742
Age: 0
Via: 1.1 varnish
Connection: keep-alive
```

... whereas `curl` shows:

```
GET / HTTP/1.1
User-Agent: curl/7.22.0 (x86_64-apple-darwin11.1.0) libcurl/7.22.0 OpenSSL/1.0.0e zlib/1.2.5 libidn/1.22
Host: www.rankingz.com
Accept: */*

HTTP/1.1 200 OK
Server: Apache
X-Powered-By: PHP/5.3.2-1ubuntu4.10
X-Pingback: http://www.rankingz.com/xmlrpc.php
Last-Modified: Mon, 14 Nov 2011 14:25:32 GMT
Vary: Cookie,Accept-Encoding
Expires: Mon, 14 Nov 2011 14:26:52 GMT
Pragma: public
Cache-Control: public
Content-Type: text/html; charset=UTF-8
X-Cacheable: NO: Vary: Cookie
Content-Length: 25914
Date: Mon, 14 Nov 2011 14:25:32 GMT
X-Varnish: 875757934
Age: 0
Via: 1.1 varnish
Connection: keep-alive
```

`requests` should be using  "GET /" instead of "GET http://www.rankingz.com".


For what it is worth, an earlier version works fine:

```
>>> requests.__version__
'0.6.2 (dev)'
>>> requests.get('http://www.jibecompany.com')
<Response [200]>
```

This one indeed uses the following headers:

```
GET / HTTP/1.1
Host: www.jibecompany.com
User-Agent: python-requests.org
Connection: close
Accept-Encoding: gzip
```

Btw, the URLs we are experiencing issues with all seem to be Wordpress based (http://www.dancetunesradio.com is another...).


Compare https://github.com/kennethreitz/requests/issues/256


Yes, this is also related to #256, apparently related to a bug in  [urllib3#8](https://github.com/shazow/urllib3/issues/8)…


Not a bug in urllib3.


I'm having a hard time tracking this down. Some debugging print statements show that [_build_url()](https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L285) is being called like 4 times for one request. The url is fine after one instance of _build_url(), but after that, self.url becomes the malformed url. The malformed URL first appears at [r.headers](https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L207).

Not sure if this is helpful, but it might get someone else on the right track.


Fixed in 4504953212816c4de0cd8177faf1270e42cb31f9


v0.8.1 was just released, which fixes this!


Really nice!


Awesome! :beer:


i have same issue in requests '1.1.0'


the code "requests.get(self.url%self.version, auth=(self.user, self.pwd))" i used
unfortunately, pop up "Max retries exceeded with url:"


@teslachiang: Can you paste your full traceback, please? =)


@teslachiang also, could you post the URL? 


Sending the full URL instead of the path is [allowed by the RFC](http://www.ietf.org/rfc/rfc2616.txt), so this was not a bug.


@untitaker: Just because the RFC allows it doesn't stop it being a bug. =)


@Lukasa If this is not a misbehavior, how would this be a bug then?


It _is_  a misbehaviour, it's just one that's allowed by the RFC. =D

RFCs allow and require many kinds of behaviour. Some of this behaviour is, in practice, not followed by the overwhelming majority of clients. This can lead to these clients choking on our input. It's all well and good to stand tall and say "I followed the RFC", but if every webserver in the world rejects our HTTP input then we've done a crappy job of making an HTTP library.

An excellent example of what I mean is #1051. A zero-length Content-Type header on a GET is fine, but it killed Amazon. We could file an angry complaint with them and stand on our high horse, or we could just acknowledge that most people don't do it that way, and it's better to work properly than be what I am choosing to call 'aggressively standards compliant'. =D


Of course it's good to aim at compatibility with servers that don't understand all kinds of RFC-compilant requests, but doing that would be rather a feature than a bugfix in my eyes.


You are free to call it whatever you like. =)