title: How to access request object in router function using FastAPI?
body: <p>I am new to FastAPI framework, I want to print out the response. For example, in Django:</p>
  <pre><code>@api_view(['POST'])
  def install_grandservice(req):
      print(req.body)
  </code></pre>
  <p>And in FastAPI:</p>
  <pre><code>@app.post('/install/grandservice')
  async def login():
     //print out req
  </code></pre>
  <p>I tried to to like this</p>
  <pre><code>@app.post('/install/grandservice')
  async def login(req):
      print(req.body)
  </code></pre>
  <p>But I received this error: <strong>127.0.0.1:52192 - &quot;POST /install/login HTTP/1.1&quot; 422 Unprocessable Entity</strong></p>
  <p>Please help me :(</p>