title: Determine request size before processing it
body: <p>I need to be able to read the <code>Content-Length</code> header of requests before they are actually processed. </p>
  
  <p>My exact problem currently is that I have a mobile application, pushed to many users, who send data every 30 seconds. If the data push didn't work (no internet, for instance) or the server doesn't respond with 200, 201 or 202, it keeps the data in a DB on the phone and tries again later to send it to the server.</p>
  
  <p>This worked as expected, until some clients started accumulating megabytes of data (probably no internet connection for an extended period of time). Now when the device sends the data, the server correctly saves it but takes 3-4 seconds to reply. This is too long, and the mobile device assumes the data has not been accepted and keeps it in its database. </p>
  
  <p>So I have client sending me megabytes of data every 30 seconds, which is really bad. I would like to respond with <code>202 Accepted</code> as soon as I receive the data, so the mobile app clears the cache and I insert the data in the database on the server later.</p>
  
  <p>I know that <code>app.use(express.json({limit: '10mb'}));</code> can read the size of a request before it's been processed, because it fires a 413 code in a few milliseconds after starting to receive the request. How does it read the size before processing it?</p>
  
  <p>Thank you</p>