private static HttpRequest constructPostRequest(URI request, String body) {
        return HttpRequest.newBuilder().uri(request)
                .POST(HttpRequest.BodyPublishers.ofString(body))
                .headers(CONTENT_TYPE, APPLICATION_FORM_URLENCODED,
                        FORM_IS_RESUBMITTED, Boolean.TRUE.toString())
                .build();
    }
flash cookie is preserved here

@param request
@param response
@param path
@param paramValues
support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java