In Java 11 HttpClient how to solve restricted header name: Date
问题 The following java 11 code: HttpRequest request = HttpRequest.newBuilder() .uri(uri) .header("Digest", digest) .header("Date", date) .build(); gives the following error: Exception in thread "main" java.lang.IllegalArgumentException: restricted header name: "Date" The problem is that the digest is based on the date, so I cannot simply rely on the http client date, because that will make the digest invalid. I need a way to either set the Date header, or to retrieve the Date header and then set