Interface JsonRpcClientRequest
- All Superinterfaces:
ClientRequest<JsonRpcClientRequest>
A representation of JSON-RPC client request.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ClientRequest
ClientRequest.OutputStreamHandlerModifier and TypeInterfaceDescriptionstatic interfaceHandle output stream. -
Method Summary
Modifier and TypeMethodDescriptiondefault JsonRpcClientRequestaddParam(int value) Add an array param value of type int to this request.Add an array param value on this request.default JsonRpcClientRequestAdd an array param value of type string to this request.Add this request to the current batch.Get a complete representation of this request as a JSON object.default JsonRpcClientRequestSet a named param of type int on this request.Set a named param on this request.default JsonRpcClientRequestSet a named param of type string on this request.default JsonRpcClientRequestrpcId(int value) Set an int JSON-RPC ID on this request.Set a JSON-RPC ID on this request.default JsonRpcClientRequestSet a string JSON-RPC ID on this request.Set a JSON-RPC method on this request.submit()Submit this request to the server and get a response.Methods inherited from interface ClientRequest
accept, accept, address, connection, contentType, followRedirects, followRedirects, fragment, fragment, header, header, header, headers, headers, headers, keepAlive, maxRedirects, maxRedirects, outputStream, outputStream, path, pathParam, property, proxy, queryParam, readContinueTimeout, readTimeout, request, request, request, requestEntity, requestEntity, resolvedUri, sendExpectContinue, skipUriEncoding, sni, sni, submit, submit, submit, tls, uri, uri, uriModifier and TypeMethodDescriptiondefault JsonRpcClientRequestAccepted media types.default JsonRpcClientRequestaccept(HttpMediaType... accepted) Accepted media types.default JsonRpcClientRequestaddress(SocketAddress socketAddress) Socket address to use.connection(ClientConnection connection) This method is for explicit connection use by this request.default JsonRpcClientRequestcontentType(MediaType contentType) Sets the content type of the request.booleanWhether to follow redirects.followRedirects(boolean followRedirects) Whether to follow redirects.fragment(UriFragment fragment) Set fragment of the URI.default JsonRpcClientRequestSet fragment of the URI.Set an HTTP header.default JsonRpcClientRequestheader(HeaderName name, String... values) Set an HTTP header.default JsonRpcClientRequestheader(HeaderName name, List<String> values) Set an HTTP header with multiple values.headers()Get a (mutable) instance of outgoing headers.Configure headers.headers(Consumer<ClientRequestHeaders> headersConsumer) Update headers.keepAlive(boolean keepAlive) Whether to use keep alive with this request.intMaximal number of redirects to follow.maxRedirects(int maxRedirects) Max number of the followed redirects.outputStream(ClientRequest.OutputStreamHandler outputStreamConsumer) Handle output stream and submit the request.default <T> ClientResponseTyped<T> outputStream(ClientRequest.OutputStreamHandler outputStreamConsumer, Class<T> requestedType) Handle output stream and request a specific type.default JsonRpcClientRequestConfigure path to call.Replace a placeholder in URI with an actual value.Add a property to be used by this request.Proxy configuration for this specific request.queryParam(String name, String... values) Add query parameter.readContinueTimeout(Duration readContinueTimeout) Read 100-Continue timeout for this request.readTimeout(Duration readTimeout) Read timeout for this request.default HttpClientResponserequest()Request without an entity.default <E> ClientResponseTyped<E> request(GenericType<E> type) Request without sending an entity.default <E> ClientResponseTyped<E> Request without sending an entity.default <E> ErequestEntity(GenericType<E> type) Request entity without sending a request entity, asking for entity only.default <E> ErequestEntity(Class<E> type) Request entity without sending a request entity, asking for entity only.Resolved URI that will be used to invoke this request.sendExpectContinue(boolean sendExpectContinue) Whether Expect 100-Continue header is sent to verify server availability before sending an entity.skipUriEncoding(boolean skip) Disable uri encoding.default JsonRpcClientRequestConfigure client-side TLS SNI for this request.default JsonRpcClientRequestsni(Consumer<SniConfig.Builder> sni) Configure client-side TLS SNI for this request.Submit an entity.default <E> ClientResponseTyped<E> submit(Object entity, GenericType<E> requestedType) Submit an entity and request a specific type.default <E> ClientResponseTyped<E> Submit an entity and request a specific type.TLS configuration for this specific request.Configure request URI.default JsonRpcClientRequestConfigure URI.Configure URI.
-
Method Details
-
rpcMethod
Set a JSON-RPC method on this request. Normally this is done using either viaJsonRpcClientorJsonRpcClientBatchRequest.- Parameters:
rpcMethod- the JSON-RPC method- Returns:
- this request
- See Also:
-
rpcId
Set a JSON-RPC ID on this request.- Parameters:
value- the ID as a JSON value- Returns:
- this request
-
rpcId
Set an int JSON-RPC ID on this request.- Parameters:
value- the ID as an int- Returns:
- this request
-
rpcId
Set a string JSON-RPC ID on this request.- Parameters:
value- the ID as a string- Returns:
- this request
-
param
Set a named param on this request.- Parameters:
name- the namevalue- the value as a JSON value- Returns:
- this request
-
param
Set a named param of type string on this request.- Parameters:
name- the namevalue- the value as a string- Returns:
- this request
-
param
Set a named param of type int on this request.- Parameters:
name- the namevalue- the value as an int- Returns:
- this request
-
addParam
Add an array param value on this request.- Parameters:
value- the value as JSON value- Returns:
- this request
-
addParam
Add an array param value of type int to this request.- Parameters:
value- the value as int value- Returns:
- this request
-
addParam
Add an array param value of type string to this request.- Parameters:
value- the value as a string- Returns:
- this request
-
submit
JsonRpcClientResponse submit()Submit this request to the server and get a response.- Returns:
- a response
-
addToBatch
JsonRpcClientBatchRequest addToBatch()Add this request to the current batch.- Returns:
- the batch
- Throws:
IllegalStateException- if not part of a batch
-
asJsonObject
JsonObject asJsonObject()Get a complete representation of this request as a JSON object.- Returns:
- this request as a JSON object
-