title: Requests in Asyncio - Keyword Arguments
body: <p>I'm using <em>asyncio</em> with the <em>requests</em> module to make an asynchronous HTTP request.</p>
  
  <p>I can make a GET request like this:</p>
  
  <pre><code>@asyncio.coroutine
  def do_checks():
      loop = asyncio.get_event_loop()
      req = loop.run_in_executor(None, requests.get, 'https://api.github.com/user')
      resp = yield from req
      print(resp.status_code)
  loop = asyncio.get_event_loop()
  loop.run_until_complete(do_checks())
  </code></pre>
  
  <p>However, I need to do support Basic HTTP Auth (<a href="http://docs.python-requests.org/en/v0.10.6/api/?highlight=auth#requests.Request.auth">described here</a>) in the request.</p>
  
  <p>According to the documentation, <em>url</em> and <em>auth</em> are both named parameters for requests.get().</p>
  
  <p>But, if I run this (note the addition of <strong>url=''</strong> and <strong>auth = ''</strong>):</p>
  
  <pre><code>@asyncio.coroutine
  def do_checks():
      loop = asyncio.get_event_loop()
      req = loop.run_in_executor(None, requests.get, url='https://api.github.com/user', auth=HTTPBasicAuth('user', 'pass'))
      resp = yield from req
      print(resp.status_code)
  loop = asyncio.get_event_loop()
  loop.run_until_complete(do_checks())
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>TypeError: run_in_executor() got an unexpected keyword argument 'url'
  </code></pre>
  
  <p>In the prototype for asyncio.run_in_executor(), additional arguments are supported:</p>
  
  <pre><code>BaseEventLoop.run_in_executor(executor, callback, *args)
  </code></pre>
  
  <p>requests.get() clearly supports named parameters (get, auth, etc.). What's wrong?</p>