title: aiohttp: how to make simple http request
body: <p>I am exploring aiohttp for async http requests.</p>
  <p>The client quickstart on the aiohttp <a href="https://docs.aiohttp.org/en/stable/client_quickstart.html#make-a-request" rel="nofollow noreferrer">website</a>   suggests this code as a minimal example:</p>
  <pre><code>import aiohttp
  async with aiohttp.ClientSession() as session:
      async with session.get('http://httpbin.org/get') as resp:
          print(resp.status)
          print(await resp.text())
  </code></pre>
  <p>For me on python 3.6.5 this results in</p>
  <blockquote>
  <p>async with aiohttp.ClientSession() as session:</p>
  <p>SyntaxError: invalid syntax</p>
  </blockquote>
  <p>Am I missing something here?</p>
  <p>Any help is appreciated! Thank you.</p>
  <h3>edit:</h3>
  <p>I was doing test. First I realized I needed python 3.7.
  So I switched and now the error message is:</p>
  <blockquote>
  <p>async with aiohttp.ClientSession() as session:</p>
  <p>SyntaxError: 'async with' outside async function</p>
  </blockquote>