code: @SuppressWarnings("PMD.EmptyCatchBlock")
      public static void sendResponse(HttpRequest request,
              IOSubchannel channel, int statusCode, String reasonPhrase) {
          HttpResponse response = request.response().get();
          response.setStatusCode(statusCode).setReasonPhrase(reasonPhrase)
              .setHasPayload(true).setField(
                  HttpField.CONTENT_TYPE,
                  MediaType.builder().setType("text", "plain")
                      .setParameter("charset", "utf-8").build());
          // Act like a sub-component, i.e. generate events that are
          // handled by this HTTP server as if sent from a sub-component.
          channel.respond(new Response(response));
          try {
              channel.respond(Output.from((statusCode + " " + reasonPhrase)
                  .getBytes("utf-8"), true));
          } catch (UnsupportedEncodingException e) {
              // Supported by definition
          }
      }
docs: Send a response to the given request with the given status code
  and reason phrase, including a `text/plain` body with the status
  code and reason phrase.
  
  @param request the request
  @param channel for responding; events will be sent using
  {@link IOSubchannel#respond(org.jgrapes.core.Event)}
  @param statusCode the status code to send
  @param reasonPhrase the reason phrase to send