HttpRequest.Builder (Java SE 11 & JDK 11 [ad-hoc build]) (original) (raw)


public static interface HttpRequest.Builder
A builder of HTTP requests.
Instances of HttpRequest.Builder are created by calling HttpRequest.newBuilder(URI) or HttpRequest.newBuilder().
Each of the setter methods modifies the state of the builder and returns the same instance. The methods are not synchronized and should not be called from multiple threads without external synchronization. The build method returns a newHttpRequest each time it is invoked. Once built an HttpRequest is immutable, and can be sent multiple times.
Note, that not all request headers may be set by user code. Some are restricted for security reasons and others such as the headers relating to authentication, redirection and cookie management may be managed by specific APIs rather than through directly user set headers.
Since:
11

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
DRAFT 11-internal+0-adhoc.chhegar.open