title: What is causing intermittent SEC_E_BUFFER_TOO_SMALL error coming from WinHttpSendRequest?
body: <p>I have a tool which executes an HTTP<strong>S</strong> POST command against the same URL with same headers, same post body, etc. for a number of iterations.</p>
  
  <p>What I have run into is that for some testers, every so often the WinHttpSendRequest() function fails and the subsequent call to GetLastError() returns SEC_E_BUFFER_TOO_SMALL (0x80090321) documented here: <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd542646.aspx" rel="noreferrer">COM Error Codes (Security and Setup)</a>.</p>
  
  <p>This is not a documented error code for WinHttpSendRequest() and fairly extensive Googling has not turned up anything at all for this.</p>
  
  <p>I have quadruple checked that the inputs I am providing WinHttpSendRequest() are correct and valid, and those inputs work tens of thousands of times in a row... until it doesn't.</p>
  
  <p>I cannot provide a MVCE, but under the assumptions provided here, Im looking for any possible reason for the error code coming back.</p>