Adds `quote_plus` option


Some sites give a 401 error when encoding url parameters and body data with the default urlencode function, as they send `+` instead of `%20` for encoding spaces.

An issue for this has been posted to [urllib](http://bugs.python.org/issue13866) but as it doesn't seem to be nowhere near to be accepted. I propose that an additional parameter can be added to requests API to replicate that feature.


This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2031301) (merged 3dcaff99 into b5ca4b44).


Instead of adding a new option, I'd rather fix our encoding (which has been worked on heavily).

A web browser doesn't have url parsing options, so Reqeusts shouldn't need one either.


@kennethreitz , the problem is not how browsers work, there are some APIs which use OAuth and need specifically to receive `%20` as the scape character for `space` according to the [RFC 5849](http://tools.ietf.org/html/rfc5849#section-3.6)

This should be an available option, as if it is done other way, it would result in a 401 response


Why not always send `%20`? That's what the browsers do, no?


Not sure about that, urls are formatted with `+` in browsers, and `application/xxx-form-urlencoded` sent with post from browsers too.


I've just had the same problem with an API that requires spaces in the query string to be encoded as `%20` (it does not like `+`).

Requests uses `urllib.urlencode` to build the query string from the _params_ argument, which in turn uses `urllib.quote_plus`, which causes the problem (see [Python issue 13866](http://bugs.python.org/issue13866) mentioned earlier).

I have seen several APIs that break when you encode spaces as `+` instead of `%20`, but I have never seen the opposite case. So I guess it would be OK to default to using `%20` in query strings (i.e. use `quote`), and maybe add an optional parameter to use pluses instead (using `quote_plus`). The use of `urlencode` would then be limited to the encoding of POST data.


@ronnix since we now provide the fully mutable PreparedRequest object, you can change the url to be whatever you need :)


Thanks. I've glanced at the code, but do you have an example of how I would use that?


Roughly:

``` python

from requests import Request, session

request = Request('GET', 'https://example.com', data='foo bar bogus')
prepared = request.prepare()
prepared.url = 'https://abc.example.com'
s = session()
s.send(prepared)
```


Thanks, but why do I need the prepared request anyway? Can I just build my URL and use it with `requests.get`, like:

```
url = 'https://example.com/?' + _build_my_query_string()
response = requests.get(url)
```


@ronnix yeah that will work too


@sigmavirus24 

```
prepared = request.prepare()
prepared.url = 'https://abc.example.com'
```

Out of curiosity; how can user know what is safe to change after the request had been prepared? It looks like playing with fire :)


The `PreparedRequest` object is a perfect example of the "we're all consenting adults here" philosophy. Yes, you can totally break your request if you do something silly with the `PreparedRequest`. However, there are also plenty of things you can usefully do with that kind of low-level access. That complexity is only shown to a user who specifically asks for it, by using `Request.prepare()`, so it won't bite anyone. =)