public final ByteBuffer serializeWithHeader(RequestHeader header) {
        if (header.apiKey() != apiKey) {
            throw new IllegalArgumentException("Could not build request " + apiKey + " with header api key " + header.apiKey());
        }
        if (header.apiVersion() != version) {
            throw new IllegalArgumentException("Could not build request version " + version + " with header version " + header.apiVersion());
        }
        return RequestUtils.serialize(header.data(), header.headerVersion(), data(), version);
    }
Serializes header and body without prefixing with size (unlike `toSend`, which does include a size prefix).
clients/src/main/java/org/apache/kafka/common/requests/AbstractRequest.java