src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClient.java
branchhttp-client-branch
changeset 56087 e73e506a1969
parent 56086 ba42a59d3072
equal deleted inserted replaced
56086:ba42a59d3072 56087:e73e506a1969
    42 import jdk.incubator.http.HttpResponse.PushPromiseHandler;
    42 import jdk.incubator.http.HttpResponse.PushPromiseHandler;
    43 import jdk.incubator.http.internal.HttpClientBuilderImpl;
    43 import jdk.incubator.http.internal.HttpClientBuilderImpl;
    44 
    44 
    45 /**
    45 /**
    46  * An HTTP Client.
    46  * An HTTP Client.
    47  * {@Incubating}
       
    48  *
    47  *
    49  * <p> An {@code HttpClient} can be used to send requests and retrieve their
    48  * <p> An {@code HttpClient} can be used to send requests and retrieve their
    50  * responses. An {@code HttpClient} is created through a {@link
    49  * responses. An {@code HttpClient} is created through a {@link
    51  * HttpClient#newBuilder() builder}. The builder can be used to configure
    50  * HttpClient#newBuilder() builder}. The builder can be used to configure
    52  * per-client state, like: the preferred protocol version ( HTTP/1.1 or HTTP/2 ),
    51  * per-client state, like: the preferred protocol version ( HTTP/1.1 or HTTP/2 ),
   120         return new HttpClientBuilderImpl();
   119         return new HttpClientBuilderImpl();
   121     }
   120     }
   122 
   121 
   123     /**
   122     /**
   124      * A builder of immutable {@link HttpClient}s.
   123      * A builder of immutable {@link HttpClient}s.
   125      * {@Incubating}
       
   126      *
   124      *
   127      * <p> Builders are created by invoking {@linkplain HttpClient#newBuilder()
   125      * <p> Builders are created by invoking {@linkplain HttpClient#newBuilder()
   128      * newBuilder}. Each of the setter methods modifies the state of the builder
   126      * newBuilder}. Each of the setter methods modifies the state of the builder
   129      * and returns the same instance. Builders are not thread-safe and should not be
   127      * and returns the same instance. Builders are not thread-safe and should not be
   130      * used concurrently from multiple threads without external synchronization.
   128      * used concurrently from multiple threads without external synchronization.
   383      */
   381      */
   384     public abstract Optional<Executor> executor();
   382     public abstract Optional<Executor> executor();
   385 
   383 
   386     /**
   384     /**
   387      * The HTTP protocol version.
   385      * The HTTP protocol version.
   388      * {@Incubating}
       
   389      *
   386      *
   390      * @since 11
   387      * @since 11
   391      */
   388      */
   392     public enum Version {
   389     public enum Version {
   393 
   390 
   402         HTTP_2
   399         HTTP_2
   403     }
   400     }
   404 
   401 
   405     /**
   402     /**
   406      * Defines automatic redirection policy.
   403      * Defines automatic redirection policy.
   407      * {@Incubating}
       
   408      *
   404      *
   409      * <p> This is checked whenever a {@code 3XX} response code is received. If
   405      * <p> This is checked whenever a {@code 3XX} response code is received. If
   410      * redirection does not happen automatically then the response is returned
   406      * redirection does not happen automatically then the response is returned
   411      * to the user, where it can be handled manually.
   407      * to the user, where it can be handled manually.
   412      *
   408      *