setHeaders([ 'Host' => 'example.org', 'Content-Type' => 'application/json' ]); $request->setBody(json_encode(['foo' => 'bar'])); echo $request; echo "\r\n\r\n"; $response = new Response(424); $response->setHeaders([ 'Content-Type' => 'text/plain', 'Connection' => 'close', ]); $response->setBody("ABORT! ABORT!"); echo $response; echo "\r\n";