class RestRequest extends RestMessage {

    @Override
    protected byte[] toByteArray() {
        try (ByteArrayOutputStream bof = new ByteArrayOutputStream()) {
            writeString(bof, verb.toString());
            bof.write(CRLF);
            writeString(bof, requestPath);
            if (query != null) {
                writeString(bof, "?");
                writeString(bof, query);
            }
            bof.write(CRLF);
            serializeHeaders(headers, bof, h -> true);
            return bof.toByteArray();
        } catch (Exception io) {
            throw new IllegalStateException("Unable to serialize request", io);
        }
    }

    public  RestRequest(byte[] messageBytes);
    public  RestRequest(String verb, String path, String query, List<Header> headers, String xRequestId);

}