{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/2801","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/2801/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/2801/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/2801/events","html_url":"https://github.com/kennethreitz/requests/issues/2801","id":109603572,"number":2801,"title":"async and await","user":{"login":"screendriver","id":149248,"avatar_url":"https://avatars.githubusercontent.com/u/149248?v=3","gravatar_id":"","url":"https://api.github.com/users/screendriver","html_url":"https://github.com/screendriver","followers_url":"https://api.github.com/users/screendriver/followers","following_url":"https://api.github.com/users/screendriver/following{/other_user}","gists_url":"https://api.github.com/users/screendriver/gists{/gist_id}","starred_url":"https://api.github.com/users/screendriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screendriver/subscriptions","organizations_url":"https://api.github.com/users/screendriver/orgs","repos_url":"https://api.github.com/users/screendriver/repos","events_url":"https://api.github.com/users/screendriver/events{/privacy}","received_events_url":"https://api.github.com/users/screendriver/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-03T05:44:51Z","updated_at":"2015-10-03T07:30:28Z","closed_at":"2015-10-03T07:30:28Z","body":"Python 3.5 [introduced](https://docs.python.org/3/whatsnew/3.5.html#new-features) coroutines with async and await syntax. Specification about that can be read in [PEP 492](https://www.python.org/dev/peps/pep-0492/).\r\n\r\nAre there any plans to support this?  Because of network lags or slow connections it would make sense to make asynchronous http requests."},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/145211775","html_url":"https://github.com/kennethreitz/requests/issues/2801#issuecomment-145211775","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/2801","id":145211775,"user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T07:30:28Z","updated_at":"2015-10-03T07:30:28Z","body":"@screendriver At the current time there are no plans to support a sync and await. This is not because they aren't a good idea: they are. It's because to use them requires quite substantial code changes.\r\n\r\nRight now requests is a purely synchronous library that, at the bottom of its stack, uses `httplib` to send and receive data. We cannot move to an async model unless we replace httplib. The best we could do is provide a shorthand to run a request in a thread, but asyncio already has just such a shorthand, so I don't believe it would be valuable.\r\n\r\nRight now I am quietly looking at whether we can rewrite requests to work just as well in a synchronous environment as in an async one. However, the reality is that doing so will be a lot of work, involving rewriting a lot of our stack, and may not happen for many years, if ever."}}