Interface Http1ClientRequest
- All Superinterfaces:
ClientRequest<Http1ClientRequest>
Client request for HTTP/1.1.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ClientRequest
ClientRequest.OutputStreamHandlerModifier and TypeInterfaceDescriptionstatic interfaceHandle output stream. -
Method Summary
Modifier and TypeMethodDescriptionoutputStream(ClientRequest.OutputStreamHandler outputStreamConsumer) Handle an output stream and submit this request.default Http1ClientResponserequest()Request without an entity.Submit the request with the provided entity.Upgrade the current request to a different protocol.Methods inherited from interface ClientRequest
accept, accept, address, connection, contentType, followRedirects, followRedirects, fragment, fragment, header, header, header, headers, headers, headers, keepAlive, maxRedirects, maxRedirects, outputStream, path, pathParam, property, proxy, queryParam, readContinueTimeout, readTimeout, request, request, requestEntity, requestEntity, requestTarget, resolvedUri, sendExpectContinue, skipUriEncoding, sni, sni, submit, submit, tls, uri, uri, uriModifier and TypeMethodDescriptiondefault Http1ClientRequestAccepted media types.default Http1ClientRequestaccept(HttpMediaType... accepted) Accepted media types.default Http1ClientRequestaddress(SocketAddress socketAddress) Socket address to use.connection(ClientConnection connection) This method is for explicit connection use by this request.default Http1ClientRequestcontentType(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 Http1ClientRequestSet fragment of the URI.Set an HTTP header.default Http1ClientRequestheader(HeaderName name, String... values) Set an HTTP header.default Http1ClientRequestheader(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.default <T> ClientResponseTyped<T> outputStream(ClientRequest.OutputStreamHandler outputStreamConsumer, Class<T> requestedType) Handle output stream and request a specific type.default Http1ClientRequestConfigure 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 <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.default Http1ClientRequestrequestTarget(HttpPrologue prologue) Replace the request path and query with the target from an HTTP prologue.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 Http1ClientRequestConfigure client-side TLS SNI for this request.default Http1ClientRequestsni(Consumer<SniConfig.Builder> sni) Configure client-side TLS SNI for this request.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 Http1ClientRequestConfigure URI.Configure an existing URI.
-
Method Details
-
submit
Submit the request with the provided entity. For streamed entities, anEntityWriterwithout instance-writer support can run on a helper virtual thread using the current Helidon context. The writer can prepare request headers before its first output, and this method waits for the writer to terminate, including when an early response cancels the upload.- Specified by:
submitin interfaceClientRequest<Http1ClientRequest>- Parameters:
entity- request entity- Returns:
- response
-
request
Description copied from interface:ClientRequestRequest without an entity.- Specified by:
requestin interfaceClientRequest<Http1ClientRequest>- Returns:
- response
-
outputStream
Handle an output stream and submit this request. When negotiatingExpect: 100-continue, request headers are sent before invoking the handler. An early final response or a redirect that discards the request entity can therefore bypass the handler entirely. Configure request headers before calling this method, rather than inside the handler.A handler that writes no bytes can still trigger the handshake when the content length is unknown. An explicit content length of zero bypasses the handshake. A method-preserving redirect received after an upload can invoke the handler again to replay the entity.
- Specified by:
outputStreamin interfaceClientRequest<Http1ClientRequest>- Parameters:
outputStreamConsumer- handler that writes and closes the request output stream- Returns:
- response
-
upgrade
Upgrade the current request to a different protocol. As an upgrade is executing the usual HTTP method call, in case of failure to upgrade, the response will be a usual full HTTP response that you would get without an upgrade attempt.Note that the response returned will trigger different behavior depending on whether the upgraded succeeded or failed. For success, it will not close the connection (or return it to the pool), and the upgrade caller must correctly handle the connection close. In case of failure, this is just a regular client response that closes the connection (or returns it to the pool)
- Parameters:
protocol- protocol ID for upgrade- Returns:
- upgrade response
-