code: private ApacheHttpRequest<GenericRecord> buildWriteRequest(BufferedRecord<GenericRecord> record) {
      if (record == null) {
        return null;
      }
  
      ApacheHttpRequest<GenericRecord> request = new ApacheHttpRequest<>();
      HttpOperation httpOperation = HttpUtils.toHttpOperation(record.getRecord());
  
      // Set uri
      URI uri = HttpUtils.buildURI(urlTemplate, httpOperation.getKeys(), httpOperation.getQueryParams());
      if (uri == null) {
        return null;
      }
  
      RequestBuilder builder = RequestBuilder.create(verb.toUpperCase());
      builder.setUri(uri);
  
      // Set headers
      Map<String, String> headers = httpOperation.getHeaders();
      if (headers != null && headers.size() != 0) {
        for (Map.Entry<String, String> header : headers.entrySet()) {
          builder.setHeader(header.getKey(), header.getValue());
        }
      }
  
      // Add payload
      int bytesWritten = addPayload(builder, httpOperation.getBody());
      if (bytesWritten == -1) {
        throw new RuntimeException("Fail to write payload into request");
      }
  
      request.setRawRequest(build(builder));
      request.markRecord(record, bytesWritten);
      return request;
    }
docs: Build a write request from a single record