MockWebServer response delay - testing timeouts
<p>I'm trying to test HTTP timeout scenarios using a MockWebServer which answers my test requests sent with Retrofit/OkHttp. (This question <a href="https://stackoverflow.com/questions/26778379/delay-mockwebserver-response">was asked before</a> some years ago, but at the time concerned a bug in the MockWebServer. Also, the API has since changed a fair bit, so I think reposting this question is warranted.)</p>

<p>There seem to be several related methods, but I'd appreciate a solution to this issue with a clear example: I'm unsure about the difference between..</p>

<ul>
<li><code>.delayBody</code> and</li>
<li><code>.throttleBody</code></li>
</ul>

<p>Also, both of these methods seem to only delay/throttle the body - is it not possible to set a timeout for the response header? I.e. something along the lines of "wait X seconds after the next incoming request before you send out any response".</p>