java.net.http
22 classes of the module java.net.http.
Load them with:
using {
"java.net.http"
}
HttpClient#
abstract · extends Object · java.net.http.HttpClient
Implements: AutoCloseable
Methods
| Method | Ring call | Java overloads |
|---|---|---|
authenticator | authenticator() | Optional authenticator() |
awaitTermination | awaitTermination(duration) | boolean awaitTermination(Duration duration) |
close | close() | void close() |
connectTimeout | connectTimeout() | Optional connectTimeout() |
cookieHandler | cookieHandler() | Optional cookieHandler() |
executor | executor() | Optional executor() |
followRedirects | followRedirects() | Redirect followRedirects() |
isTerminated | isTerminated() | boolean isTerminated() |
newBuilder | newBuilder() | static Builder newBuilder() |
newHttpClient | newHttpClient() | static HttpClient newHttpClient() |
newWebSocketBuilder | newWebSocketBuilder() | Builder newWebSocketBuilder() |
proxy | proxy() | Optional proxy() |
send | send(request,responseBodyHandler) | HttpResponse send(HttpRequest request, BodyHandler responseBodyHandler) |
sendAsync | sendAsync([request,responseBodyHandler])sendAsync([ :request = v, :responseBodyHandler = v ])sendAsync([request,responseBodyHandler,pushPromiseHandler])sendAsync([ :request = v, :responseBodyHandler = v, :pushPromiseHandler = v ]) | CompletableFuture sendAsync(HttpRequest request, BodyHandler responseBodyHandler)CompletableFuture sendAsync(HttpRequest request, BodyHandler responseBodyHandler, PushPromiseHandler pushPromiseHandler) |
shutdown | shutdown() | void shutdown() |
shutdownNow | shutdownNow() | void shutdownNow() |
sslContext | sslContext() | SSLContext sslContext() |
sslParameters | sslParameters() | SSLParameters sslParameters() |
version | version() | Version version() |
The methods and fields of Object are inherited.
HttpClientBuilder#
interface · java.net.http.HttpClient$Builder
Fields
| Name | Type | Access | In Ring |
|---|---|---|---|
NO_PROXY | ProxySelector | constant · static | o.NO_PROXY |
Methods
| Method | Ring call | Java overloads |
|---|---|---|
authenticator | authenticator(authenticator) | Builder authenticator(Authenticator authenticator) |
build | build() | HttpClient build() |
connectTimeout | connectTimeout(duration) | Builder connectTimeout(Duration duration) |
cookieHandler | cookieHandler(cookieHandler) | Builder cookieHandler(CookieHandler cookieHandler) |
executor | executor(executor) | Builder executor(Executor executor) |
followRedirects | followRedirects(policy) | Builder followRedirects(Redirect policy) |
localAddress | localAddress(localAddr) | Builder localAddress(InetAddress localAddr) |
priority | priority(priority) | Builder priority(int priority) |
proxy | proxy(proxySelector) | Builder proxy(ProxySelector proxySelector) |
sslContext | sslContext(sslContext) | Builder sslContext(SSLContext sslContext) |
sslParameters | sslParameters(sslParameters) | Builder sslParameters(SSLParameters sslParameters) |
version | version(version) | Builder version(Version version) |
HttpClientRedirect#
enum · extends Enum · java.net.http.HttpClient$Redirect
Fields
| Name | Type | Access | In Ring |
|---|---|---|---|
NEVER | Redirect | constant · static | o.NEVER |
ALWAYS | Redirect | constant · static | o.ALWAYS |
NORMAL | Redirect | constant · static | o.NORMAL |
Methods
| Method | Ring call | Java overloads |
|---|---|---|
valueOf | valueOf(p1)valueOf([enumClass,name])valueOf([ :enumClass = v, :name = v ]) | static Redirect valueOf(String p1)static Enum valueOf(Class enumClass, String name) |
values | values() | static Redirect[] values() |
The methods and fields of Enum are inherited.
HttpClientVersion#
enum · extends Enum · java.net.http.HttpClient$Version
Fields
| Name | Type | Access | In Ring |
|---|---|---|---|
HTTP_1_1 | Version | constant · static | o.HTTP_1_1 |
HTTP_2 | Version | constant · static | o.HTTP_2 |
Methods
| Method | Ring call | Java overloads |
|---|---|---|
valueOf | valueOf(p1)valueOf([enumClass,name])valueOf([ :enumClass = v, :name = v ]) | static Version valueOf(String p1)static Enum valueOf(Class enumClass, String name) |
values | values() | static Version[] values() |
The methods and fields of Enum are inherited.
HttpConnectTimeoutException#
class · extends HttpTimeoutException · java.net.http.HttpConnectTimeoutException
Constructors
new HttpConnectTimeoutException(String message) |
Ring: new HttpConnectTimeoutException(args) uses the constructor with the fewest parameters (at least one); new HttpConnectTimeoutException makes the object with the constructor without parameters; the others: (new HttpConnectTimeoutException).@New([ :param = value ]) or .@New([v1,v2]).
The methods and fields of HttpTimeoutException are inherited.
HttpHeaders#
class final · extends Object · java.net.http.HttpHeaders
Methods
| Method | Ring call | Java overloads |
|---|---|---|
allValues | allValues(name) | List allValues(String name) |
firstValue | firstValue(name) | Optional firstValue(String name) |
firstValueAsLong | firstValueAsLong(name) | OptionalLong firstValueAsLong(String name) |
map | map() | Map map() |
of | of(headerMap,filter) | static HttpHeaders of(Map headerMap, BiPredicate filter) |
The methods and fields of Object are inherited.
HttpRequest#
abstract · extends Object · java.net.http.HttpRequest
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@newBuilder | @newBuilder(uri)@newBuilder([request,filter])@newBuilder([ :request = v, :filter = v ]) | static Builder newBuilder(URI uri)static Builder newBuilder(HttpRequest request, BiPredicate filter) |
bodyPublisher | bodyPublisher() | Optional bodyPublisher() |
expectContinue | expectContinue() | boolean expectContinue() |
headers | headers() | HttpHeaders headers() |
method | method() | String method() |
newBuilder | newBuilder() | static Builder newBuilder() |
timeout | timeout() | Optional timeout() |
uri | uri() | URI uri() |
version | version() | Optional version() |
The methods and fields of Object are inherited.
HttpRequestBodyPublisher#
interface · java.net.http.HttpRequest$BodyPublisher
Extends: FlowPublisher
Methods
| Method | Ring call | Java overloads |
|---|---|---|
contentLength | contentLength() | long contentLength() |
subscribe | subscribe(subscriber) | void subscribe(Subscriber subscriber) |
HttpRequestBodyPublishers#
class · extends Object · java.net.http.HttpRequest$BodyPublishers
Methods
| Method | Ring call | Java overloads |
|---|---|---|
concat | concat(publishers) | static BodyPublisher concat(BodyPublisher[] publishers) |
fromPublisher | fromPublisher(publisher)fromPublisher([publisher,contentLength])fromPublisher([ :publisher = v, :contentLength = v ]) | static BodyPublisher fromPublisher(Publisher publisher)static BodyPublisher fromPublisher(Publisher publisher, long contentLength) |
noBody | noBody() | static BodyPublisher noBody() |
ofByteArray | ofByteArray(buf)ofByteArray([buf,offset,length])ofByteArray([ :buf = v, :offset = v, :length = v ]) | static BodyPublisher ofByteArray(byte[] buf)static BodyPublisher ofByteArray(byte[] buf, int offset, int length) |
ofByteArrays | ofByteArrays(iter) | static BodyPublisher ofByteArrays(Iterable iter) |
ofFile | ofFile(path) | static BodyPublisher ofFile(Path path) |
ofInputStream | ofInputStream(streamSupplier) | static BodyPublisher ofInputStream(Supplier streamSupplier) |
ofString | ofString(body)ofString([s,charset])ofString([ :s = v, :charset = v ]) | static BodyPublisher ofString(String body)static BodyPublisher ofString(String s, Charset charset) |
The methods and fields of Object are inherited.
HttpRequestBuilder#
interface · java.net.http.HttpRequest$Builder
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@GET | @GET() | Builder GET() |
@PUT | @PUT(bodyPublisher) | Builder PUT(BodyPublisher bodyPublisher) |
build | build() | HttpRequest build() |
copy | copy() | Builder copy() |
DELETE | DELETE() | Builder DELETE() |
expectContinue | expectContinue(enable) | Builder expectContinue(boolean enable) |
HEAD | HEAD() | Builder HEAD() |
header | header(name,value) | Builder header(String name, String value) |
headers | headers(headers) | Builder headers(String[] headers) |
method | method(method,bodyPublisher) | Builder method(String method, BodyPublisher bodyPublisher) |
POST | POST(bodyPublisher) | Builder POST(BodyPublisher bodyPublisher) |
setHeader | setHeader(name,value) | Builder setHeader(String name, String value) |
timeout | timeout(duration) | Builder timeout(Duration duration) |
uri | uri(uri) | Builder uri(URI uri) |
version | version(version) | Builder version(Version version) |
HttpResponse#
interface · java.net.http.HttpResponse
Methods
| Method | Ring call | Java overloads |
|---|---|---|
body | body() | Object body() |
connectionLabel | connectionLabel() | Optional connectionLabel() |
headers | headers() | HttpHeaders headers() |
previousResponse | previousResponse() | Optional previousResponse() |
request | request() | HttpRequest request() |
sslSession | sslSession() | Optional sslSession() |
statusCode | statusCode() | int statusCode() |
uri | uri() | URI uri() |
version | version() | Version version() |
HttpResponseBodyHandler#
interface · java.net.http.HttpResponse$BodyHandler
Methods
| Method | Ring call | Java overloads |
|---|---|---|
apply | apply(responseInfo) | BodySubscriber apply(ResponseInfo responseInfo) |
HttpResponseBodyHandlers#
class · extends Object · java.net.http.HttpResponse$BodyHandlers
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@ofString | @ofString(charset) | static BodyHandler ofString(Charset charset) |
buffering | buffering(downstreamHandler,bufferSize) | static BodyHandler buffering(BodyHandler downstreamHandler, int bufferSize) |
discarding | discarding() | static BodyHandler discarding() |
fromLineSubscriber | fromLineSubscriber(subscriber)fromLineSubscriber([subscriber,finisher,lineSeparator])fromLineSubscriber([ :subscriber = v, :finisher = v, :lineSeparator = v ]) | static BodyHandler fromLineSubscriber(Subscriber subscriber)static BodyHandler fromLineSubscriber(Subscriber subscriber, Function finisher, String lineSeparator) |
fromSubscriber | fromSubscriber(subscriber)fromSubscriber([subscriber,finisher])fromSubscriber([ :subscriber = v, :finisher = v ]) | static BodyHandler fromSubscriber(Subscriber subscriber)static BodyHandler fromSubscriber(Subscriber subscriber, Function finisher) |
limiting | limiting(downstreamHandler,capacity) | static BodyHandler limiting(BodyHandler downstreamHandler, long capacity) |
ofByteArray | ofByteArray() | static BodyHandler ofByteArray() |
ofByteArrayConsumer | ofByteArrayConsumer(consumer) | static BodyHandler ofByteArrayConsumer(Consumer consumer) |
ofFile | ofFile(file)ofFile([file,openOptions])ofFile([ :file = v, :openOptions = v ]) | static BodyHandler ofFile(Path file)static BodyHandler ofFile(Path file, OpenOption[] openOptions) |
ofFileDownload | ofFileDownload(directory,openOptions) | static BodyHandler ofFileDownload(Path directory, OpenOption[] openOptions) |
ofInputStream | ofInputStream() | static BodyHandler ofInputStream() |
ofLines | ofLines() | static BodyHandler ofLines() |
ofPublisher | ofPublisher() | static BodyHandler ofPublisher() |
ofString | ofString() | static BodyHandler ofString() |
replacing | replacing(value) | static BodyHandler replacing(Object value) |
The methods and fields of Object are inherited.
HttpResponseBodySubscriber#
interface · java.net.http.HttpResponse$BodySubscriber
Extends: FlowSubscriber
Methods
| Method | Ring call | Java overloads |
|---|---|---|
getBody | getBody() | CompletionStage getBody() |
onComplete | onComplete() | void onComplete() |
onError | onError(throwable) | void onError(Throwable throwable) |
onNext | onNext(item) | void onNext(Object item) |
onSubscribe | onSubscribe(subscription) | void onSubscribe(Subscription subscription) |
HttpResponseBodySubscribers#
class · extends Object · java.net.http.HttpResponse$BodySubscribers
Methods
| Method | Ring call | Java overloads |
|---|---|---|
buffering | buffering(downstream,bufferSize) | static BodySubscriber buffering(BodySubscriber downstream, int bufferSize) |
discarding | discarding() | static BodySubscriber discarding() |
fromLineSubscriber | fromLineSubscriber(subscriber)fromLineSubscriber([subscriber,finisher,charset,lineSeparator])fromLineSubscriber([ :subscriber = v, :finisher = v, :charset = v, :lineSeparator = v ]) | static BodySubscriber fromLineSubscriber(Subscriber subscriber)static BodySubscriber fromLineSubscriber(Subscriber subscriber, Function finisher, Charset charset, String lineSeparator) |
fromSubscriber | fromSubscriber(subscriber)fromSubscriber([subscriber,finisher])fromSubscriber([ :subscriber = v, :finisher = v ]) | static BodySubscriber fromSubscriber(Subscriber subscriber)static BodySubscriber fromSubscriber(Subscriber subscriber, Function finisher) |
limiting | limiting(downstreamSubscriber,capacity) | static BodySubscriber limiting(BodySubscriber downstreamSubscriber, long capacity) |
mapping | mapping(upstream,mapper) | static BodySubscriber mapping(BodySubscriber upstream, Function mapper) |
ofByteArray | ofByteArray() | static BodySubscriber ofByteArray() |
ofByteArrayConsumer | ofByteArrayConsumer(consumer) | static BodySubscriber ofByteArrayConsumer(Consumer consumer) |
ofFile | ofFile(file)ofFile([file,openOptions])ofFile([ :file = v, :openOptions = v ]) | static BodySubscriber ofFile(Path file)static BodySubscriber ofFile(Path file, OpenOption[] openOptions) |
ofInputStream | ofInputStream() | static BodySubscriber ofInputStream() |
ofLines | ofLines(charset) | static BodySubscriber ofLines(Charset charset) |
ofPublisher | ofPublisher() | static BodySubscriber ofPublisher() |
ofString | ofString(charset) | static BodySubscriber ofString(Charset charset) |
replacing | replacing(value) | static BodySubscriber replacing(Object value) |
The methods and fields of Object are inherited.
HttpResponsePushPromiseHandler#
interface · java.net.http.HttpResponse$PushPromiseHandler
Methods
| Method | Ring call | Java overloads |
|---|---|---|
applyPushPromise | applyPushPromise(initiatingRequest,pushPromiseRequest,acceptor) | void applyPushPromise(HttpRequest initiatingRequest, HttpRequest pushPromiseRequest, Function acceptor) |
of | of(pushPromiseHandler,pushPromisesMap) | static PushPromiseHandler of(Function pushPromiseHandler, ConcurrentMap pushPromisesMap) |
HttpResponseResponseInfo#
interface · java.net.http.HttpResponse$ResponseInfo
Methods
| Method | Ring call | Java overloads |
|---|---|---|
headers | headers() | HttpHeaders headers() |
statusCode | statusCode() | int statusCode() |
version | version() | Version version() |
HttpTimeoutException#
class · extends IOException · java.net.http.HttpTimeoutException
Constructors
new HttpTimeoutException(String message) |
Ring: new HttpTimeoutException(args) uses the constructor with the fewest parameters (at least one); new HttpTimeoutException makes the object with the constructor without parameters; the others: (new HttpTimeoutException).@New([ :param = value ]) or .@New([v1,v2]).
The methods and fields of IOException are inherited.
WebSocket#
interface · java.net.http.WebSocket
Fields
| Name | Type | Access | In Ring |
|---|---|---|---|
NORMAL_CLOSURE | int | constant · static | o.NORMAL_CLOSURE |
Methods
| Method | Ring call | Java overloads |
|---|---|---|
abort | abort() | void abort() |
getSubprotocol | getSubprotocol() | String getSubprotocol() |
isInputClosed | isInputClosed() | boolean isInputClosed() |
isOutputClosed | isOutputClosed() | boolean isOutputClosed() |
request | request(n) | void request(long n) |
sendBinary | sendBinary(data,last) | CompletableFuture sendBinary(ByteBuffer data, boolean last) |
sendClose | sendClose(statusCode,reason) | CompletableFuture sendClose(int statusCode, String reason) |
sendPing | sendPing(message) | CompletableFuture sendPing(ByteBuffer message) |
sendPong | sendPong(message) | CompletableFuture sendPong(ByteBuffer message) |
sendText | sendText(data,last) | CompletableFuture sendText(CharSequence data, boolean last) |
WebSocketBuilder#
interface · java.net.http.WebSocket$Builder
Methods
| Method | Ring call | Java overloads |
|---|---|---|
buildAsync | buildAsync(uri,listener) | CompletableFuture buildAsync(URI uri, Listener listener) |
connectTimeout | connectTimeout(timeout) | Builder connectTimeout(Duration timeout) |
header | header(name,value) | Builder header(String name, String value) |
subprotocols | subprotocols(mostPreferred,lesserPreferred) | Builder subprotocols(String mostPreferred, String[] lesserPreferred) |
WebSocketHandshakeException#
class final · extends IOException · java.net.http.WebSocketHandshakeException
Constructors
new WebSocketHandshakeException(HttpResponse response) |
Ring: new WebSocketHandshakeException(args) uses the constructor with the fewest parameters (at least one); new WebSocketHandshakeException makes the object with the constructor without parameters; the others: (new WebSocketHandshakeException).@New([ :param = value ]) or .@New([v1,v2]).
Methods
| Method | Ring call | Java overloads |
|---|---|---|
getResponse | getResponse() | HttpResponse getResponse() |
The methods and fields of IOException are inherited.
WebSocketListener#
interface · java.net.http.WebSocket$Listener
Methods
| Method | Ring call | Java overloads |
|---|---|---|
onBinary | onBinary(webSocket,data,last) | CompletionStage onBinary(WebSocket webSocket, ByteBuffer data, boolean last) |
onClose | onClose(webSocket,statusCode,reason) | CompletionStage onClose(WebSocket webSocket, int statusCode, String reason) |
onError | onError(webSocket,error) | void onError(WebSocket webSocket, Throwable error) |
onOpen | onOpen(webSocket) | void onOpen(WebSocket webSocket) |
onPing | onPing(webSocket,message) | CompletionStage onPing(WebSocket webSocket, ByteBuffer message) |
onPong | onPong(webSocket,message) | CompletionStage onPong(WebSocket webSocket, ByteBuffer message) |
onText | onText(webSocket,data,last) | CompletionStage onText(WebSocket webSocket, CharSequence data, boolean last) |