{"action":"closed","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/2445","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/2445/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/2445/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/2445/events","html_url":"https://github.com/kennethreitz/requests/issues/2445","id":57504627,"number":2445,"title":"Allow a \"url_prefix\" to be set on Session","user":{"login":"fiatjaf","id":1653275,"avatar_url":"https://avatars.githubusercontent.com/u/1653275?v=3","gravatar_id":"","url":"https://api.github.com/users/fiatjaf","html_url":"https://github.com/fiatjaf","followers_url":"https://api.github.com/users/fiatjaf/followers","following_url":"https://api.github.com/users/fiatjaf/following{/other_user}","gists_url":"https://api.github.com/users/fiatjaf/gists{/gist_id}","starred_url":"https://api.github.com/users/fiatjaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiatjaf/subscriptions","organizations_url":"https://api.github.com/users/fiatjaf/orgs","repos_url":"https://api.github.com/users/fiatjaf/repos","events_url":"https://api.github.com/users/fiatjaf/events{/privacy}","received_events_url":"https://api.github.com/users/fiatjaf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-12T19:08:05Z","updated_at":"2015-02-12T19:13:25Z","closed_at":"2015-02-12T19:13:25Z","body":"So we can do something like this:\r\n\r\n```python\r\nCOUCHDB_URL = 'https://mybigusername:myenourmouspassword@mycouchdb.provider.com/databasename/'\r\n\r\ns = requests.Session(url_prefix=COUCHDB_URL)\r\nr = s.get('/_all_docs', params=dict(include_docs=True))\r\nr = s.get('/some_document_id')\r\n```\r\n\r\nThe example uses the CouchDB API and it would almost entirely prevent the need for API wrappers like [this](https://github.com/adamlofts/couchdb-requests) (see it storing the url prefix [right here](https://github.com/adamlofts/couchdb-requests/blob/93e83d5e8cf7b0894de33747572789777dee845e/couchdbreq/resource.py#L80)). But extensive usage of any REST API would benefit from this."}}