RingJavafor Ring

java.net.http

22 classes of the module java.net.http.

Load them with:

using {
	"java.net.http"
}

All packages

HttpClient#

abstract · extends Object · java.net.http.HttpClient

Implements: AutoCloseable

Methods

MethodRing callJava overloads
authenticatorauthenticator()Optional authenticator()
awaitTerminationawaitTermination(duration)boolean awaitTermination(Duration duration)
closeclose()void close()
connectTimeoutconnectTimeout()Optional connectTimeout()
cookieHandlercookieHandler()Optional cookieHandler()
executorexecutor()Optional executor()
followRedirectsfollowRedirects()Redirect followRedirects()
isTerminatedisTerminated()boolean isTerminated()
newBuildernewBuilder()static Builder newBuilder()
newHttpClientnewHttpClient()static HttpClient newHttpClient()
newWebSocketBuildernewWebSocketBuilder()Builder newWebSocketBuilder()
proxyproxy()Optional proxy()
sendsend(request,responseBodyHandler)HttpResponse send(HttpRequest request, BodyHandler responseBodyHandler)
sendAsyncsendAsync([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)
shutdownshutdown()void shutdown()
shutdownNowshutdownNow()void shutdownNow()
sslContextsslContext()SSLContext sslContext()
sslParameterssslParameters()SSLParameters sslParameters()
versionversion()Version version()

The methods and fields of Object are inherited.

HttpClientBuilder#

interface · java.net.http.HttpClient$Builder

Fields

NameTypeAccessIn Ring
NO_PROXYProxySelectorconstant · statico.NO_PROXY

Methods

MethodRing callJava overloads
authenticatorauthenticator(authenticator)Builder authenticator(Authenticator authenticator)
buildbuild()HttpClient build()
connectTimeoutconnectTimeout(duration)Builder connectTimeout(Duration duration)
cookieHandlercookieHandler(cookieHandler)Builder cookieHandler(CookieHandler cookieHandler)
executorexecutor(executor)Builder executor(Executor executor)
followRedirectsfollowRedirects(policy)Builder followRedirects(Redirect policy)
localAddresslocalAddress(localAddr)Builder localAddress(InetAddress localAddr)
prioritypriority(priority)Builder priority(int priority)
proxyproxy(proxySelector)Builder proxy(ProxySelector proxySelector)
sslContextsslContext(sslContext)Builder sslContext(SSLContext sslContext)
sslParameterssslParameters(sslParameters)Builder sslParameters(SSLParameters sslParameters)
versionversion(version)Builder version(Version version)

HttpClientRedirect#

enum · extends Enum · java.net.http.HttpClient$Redirect

Fields

NameTypeAccessIn Ring
NEVERRedirectconstant · statico.NEVER
ALWAYSRedirectconstant · statico.ALWAYS
NORMALRedirectconstant · statico.NORMAL

Methods

MethodRing callJava overloads
valueOfvalueOf(p1)
valueOf([enumClass,name])
valueOf([ :enumClass = v, :name = v ])
static Redirect valueOf(String p1)
static Enum valueOf(Class enumClass, String name)
valuesvalues()static Redirect[] values()

The methods and fields of Enum are inherited.

HttpClientVersion#

enum · extends Enum · java.net.http.HttpClient$Version

Fields

NameTypeAccessIn Ring
HTTP_1_1Versionconstant · statico.HTTP_1_1
HTTP_2Versionconstant · statico.HTTP_2

Methods

MethodRing callJava overloads
valueOfvalueOf(p1)
valueOf([enumClass,name])
valueOf([ :enumClass = v, :name = v ])
static Version valueOf(String p1)
static Enum valueOf(Class enumClass, String name)
valuesvalues()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

MethodRing callJava overloads
allValuesallValues(name)List allValues(String name)
firstValuefirstValue(name)Optional firstValue(String name)
firstValueAsLongfirstValueAsLong(name)OptionalLong firstValueAsLong(String name)
mapmap()Map map()
ofof(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

MethodRing callJava overloads
@newBuilder@newBuilder(uri)
@newBuilder([request,filter])
@newBuilder([ :request = v, :filter = v ])
static Builder newBuilder(URI uri)
static Builder newBuilder(HttpRequest request, BiPredicate filter)
bodyPublisherbodyPublisher()Optional bodyPublisher()
expectContinueexpectContinue()boolean expectContinue()
headersheaders()HttpHeaders headers()
methodmethod()String method()
newBuildernewBuilder()static Builder newBuilder()
timeouttimeout()Optional timeout()
uriuri()URI uri()
versionversion()Optional version()

The methods and fields of Object are inherited.

HttpRequestBodyPublisher#

interface · java.net.http.HttpRequest$BodyPublisher

Extends: FlowPublisher

Methods

MethodRing callJava overloads
contentLengthcontentLength()long contentLength()
subscribesubscribe(subscriber)void subscribe(Subscriber subscriber)

HttpRequestBodyPublishers#

class · extends Object · java.net.http.HttpRequest$BodyPublishers

Methods

MethodRing callJava overloads
concatconcat(publishers)static BodyPublisher concat(BodyPublisher[] publishers)
fromPublisherfromPublisher(publisher)
fromPublisher([publisher,contentLength])
fromPublisher([ :publisher = v, :contentLength = v ])
static BodyPublisher fromPublisher(Publisher publisher)
static BodyPublisher fromPublisher(Publisher publisher, long contentLength)
noBodynoBody()static BodyPublisher noBody()
ofByteArrayofByteArray(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)
ofByteArraysofByteArrays(iter)static BodyPublisher ofByteArrays(Iterable iter)
ofFileofFile(path)static BodyPublisher ofFile(Path path)
ofInputStreamofInputStream(streamSupplier)static BodyPublisher ofInputStream(Supplier streamSupplier)
ofStringofString(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

MethodRing callJava overloads
@GET@GET()Builder GET()
@PUT@PUT(bodyPublisher)Builder PUT(BodyPublisher bodyPublisher)
buildbuild()HttpRequest build()
copycopy()Builder copy()
DELETEDELETE()Builder DELETE()
expectContinueexpectContinue(enable)Builder expectContinue(boolean enable)
HEADHEAD()Builder HEAD()
headerheader(name,value)Builder header(String name, String value)
headersheaders(headers)Builder headers(String[] headers)
methodmethod(method,bodyPublisher)Builder method(String method, BodyPublisher bodyPublisher)
POSTPOST(bodyPublisher)Builder POST(BodyPublisher bodyPublisher)
setHeadersetHeader(name,value)Builder setHeader(String name, String value)
timeouttimeout(duration)Builder timeout(Duration duration)
uriuri(uri)Builder uri(URI uri)
versionversion(version)Builder version(Version version)

HttpResponse#

interface · java.net.http.HttpResponse

Methods

MethodRing callJava overloads
bodybody()Object body()
connectionLabelconnectionLabel()Optional connectionLabel()
headersheaders()HttpHeaders headers()
previousResponsepreviousResponse()Optional previousResponse()
requestrequest()HttpRequest request()
sslSessionsslSession()Optional sslSession()
statusCodestatusCode()int statusCode()
uriuri()URI uri()
versionversion()Version version()

HttpResponseBodyHandler#

interface · java.net.http.HttpResponse$BodyHandler

Methods

MethodRing callJava overloads
applyapply(responseInfo)BodySubscriber apply(ResponseInfo responseInfo)

HttpResponseBodyHandlers#

class · extends Object · java.net.http.HttpResponse$BodyHandlers

Methods

MethodRing callJava overloads
@ofString@ofString(charset)static BodyHandler ofString(Charset charset)
bufferingbuffering(downstreamHandler,bufferSize)static BodyHandler buffering(BodyHandler downstreamHandler, int bufferSize)
discardingdiscarding()static BodyHandler discarding()
fromLineSubscriberfromLineSubscriber(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)
fromSubscriberfromSubscriber(subscriber)
fromSubscriber([subscriber,finisher])
fromSubscriber([ :subscriber = v, :finisher = v ])
static BodyHandler fromSubscriber(Subscriber subscriber)
static BodyHandler fromSubscriber(Subscriber subscriber, Function finisher)
limitinglimiting(downstreamHandler,capacity)static BodyHandler limiting(BodyHandler downstreamHandler, long capacity)
ofByteArrayofByteArray()static BodyHandler ofByteArray()
ofByteArrayConsumerofByteArrayConsumer(consumer)static BodyHandler ofByteArrayConsumer(Consumer consumer)
ofFileofFile(file)
ofFile([file,openOptions])
ofFile([ :file = v, :openOptions = v ])
static BodyHandler ofFile(Path file)
static BodyHandler ofFile(Path file, OpenOption[] openOptions)
ofFileDownloadofFileDownload(directory,openOptions)static BodyHandler ofFileDownload(Path directory, OpenOption[] openOptions)
ofInputStreamofInputStream()static BodyHandler ofInputStream()
ofLinesofLines()static BodyHandler ofLines()
ofPublisherofPublisher()static BodyHandler ofPublisher()
ofStringofString()static BodyHandler ofString()
replacingreplacing(value)static BodyHandler replacing(Object value)

The methods and fields of Object are inherited.

HttpResponseBodySubscriber#

interface · java.net.http.HttpResponse$BodySubscriber

Extends: FlowSubscriber

Methods

MethodRing callJava overloads
getBodygetBody()CompletionStage getBody()
onCompleteonComplete()void onComplete()
onErroronError(throwable)void onError(Throwable throwable)
onNextonNext(item)void onNext(Object item)
onSubscribeonSubscribe(subscription)void onSubscribe(Subscription subscription)

HttpResponseBodySubscribers#

class · extends Object · java.net.http.HttpResponse$BodySubscribers

Methods

MethodRing callJava overloads
bufferingbuffering(downstream,bufferSize)static BodySubscriber buffering(BodySubscriber downstream, int bufferSize)
discardingdiscarding()static BodySubscriber discarding()
fromLineSubscriberfromLineSubscriber(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)
fromSubscriberfromSubscriber(subscriber)
fromSubscriber([subscriber,finisher])
fromSubscriber([ :subscriber = v, :finisher = v ])
static BodySubscriber fromSubscriber(Subscriber subscriber)
static BodySubscriber fromSubscriber(Subscriber subscriber, Function finisher)
limitinglimiting(downstreamSubscriber,capacity)static BodySubscriber limiting(BodySubscriber downstreamSubscriber, long capacity)
mappingmapping(upstream,mapper)static BodySubscriber mapping(BodySubscriber upstream, Function mapper)
ofByteArrayofByteArray()static BodySubscriber ofByteArray()
ofByteArrayConsumerofByteArrayConsumer(consumer)static BodySubscriber ofByteArrayConsumer(Consumer consumer)
ofFileofFile(file)
ofFile([file,openOptions])
ofFile([ :file = v, :openOptions = v ])
static BodySubscriber ofFile(Path file)
static BodySubscriber ofFile(Path file, OpenOption[] openOptions)
ofInputStreamofInputStream()static BodySubscriber ofInputStream()
ofLinesofLines(charset)static BodySubscriber ofLines(Charset charset)
ofPublisherofPublisher()static BodySubscriber ofPublisher()
ofStringofString(charset)static BodySubscriber ofString(Charset charset)
replacingreplacing(value)static BodySubscriber replacing(Object value)

The methods and fields of Object are inherited.

HttpResponsePushPromiseHandler#

interface · java.net.http.HttpResponse$PushPromiseHandler

Methods

MethodRing callJava overloads
applyPushPromiseapplyPushPromise(initiatingRequest,pushPromiseRequest,acceptor)void applyPushPromise(HttpRequest initiatingRequest, HttpRequest pushPromiseRequest, Function acceptor)
ofof(pushPromiseHandler,pushPromisesMap)static PushPromiseHandler of(Function pushPromiseHandler, ConcurrentMap pushPromisesMap)

HttpResponseResponseInfo#

interface · java.net.http.HttpResponse$ResponseInfo

Methods

MethodRing callJava overloads
headersheaders()HttpHeaders headers()
statusCodestatusCode()int statusCode()
versionversion()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

NameTypeAccessIn Ring
NORMAL_CLOSUREintconstant · statico.NORMAL_CLOSURE

Methods

MethodRing callJava overloads
abortabort()void abort()
getSubprotocolgetSubprotocol()String getSubprotocol()
isInputClosedisInputClosed()boolean isInputClosed()
isOutputClosedisOutputClosed()boolean isOutputClosed()
requestrequest(n)void request(long n)
sendBinarysendBinary(data,last)CompletableFuture sendBinary(ByteBuffer data, boolean last)
sendClosesendClose(statusCode,reason)CompletableFuture sendClose(int statusCode, String reason)
sendPingsendPing(message)CompletableFuture sendPing(ByteBuffer message)
sendPongsendPong(message)CompletableFuture sendPong(ByteBuffer message)
sendTextsendText(data,last)CompletableFuture sendText(CharSequence data, boolean last)

WebSocketBuilder#

interface · java.net.http.WebSocket$Builder

Methods

MethodRing callJava overloads
buildAsyncbuildAsync(uri,listener)CompletableFuture buildAsync(URI uri, Listener listener)
connectTimeoutconnectTimeout(timeout)Builder connectTimeout(Duration timeout)
headerheader(name,value)Builder header(String name, String value)
subprotocolssubprotocols(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

MethodRing callJava overloads
getResponsegetResponse()HttpResponse getResponse()

The methods and fields of IOException are inherited.

WebSocketListener#

interface · java.net.http.WebSocket$Listener

Methods

MethodRing callJava overloads
onBinaryonBinary(webSocket,data,last)CompletionStage onBinary(WebSocket webSocket, ByteBuffer data, boolean last)
onCloseonClose(webSocket,statusCode,reason)CompletionStage onClose(WebSocket webSocket, int statusCode, String reason)
onErroronError(webSocket,error)void onError(WebSocket webSocket, Throwable error)
onOpenonOpen(webSocket)void onOpen(WebSocket webSocket)
onPingonPing(webSocket,message)CompletionStage onPing(WebSocket webSocket, ByteBuffer message)
onPongonPong(webSocket,message)CompletionStage onPong(WebSocket webSocket, ByteBuffer message)
onTextonText(webSocket,data,last)CompletionStage onText(WebSocket webSocket, CharSequence data, boolean last)
RingJava - use Java classes and methods from Ring programs.