title: Negotiate maximum request body size with remote server before sending a POST
body: <p>I have a Node JS server that is sending JSON objects of indeterminate size to a remote server whose limit on the body request size may not be known ahead of time.</p>
  
  <p>In the event that my JSON object exceeds the maximum request size, I want to send the data in chunks.</p>
  
  <p>I'm testing a mock implementation of the remote server that uses the npm library body-parser to set up its maximum request body size. When I sent a request that exceeded this limit, the mock remote server returned the error: <code>PayloadTooLargeError: request entity too large</code></p>
  
  <p>Question: Is there a way to determine the maximum request body size accepted by a server via the standard HTTP methods and headers?</p>