Interface Http2ClientRequest

All Superinterfaces:
ClientRequest<Http2ClientRequest>

public interface Http2ClientRequest extends ClientRequest<Http2ClientRequest>
Request of HTTP/2 client.
  • Method Details

    • priority

      Http2ClientRequest priority(int priority)
      Priority defines a weight between 1 and 256 (inclusive) to prioritize this stream by the server. Priorities are a suggestion.
      Parameters:
      priority - priority to configure for this stream (request/response)
      Returns:
      updated request
    • priorKnowledge

      Http2ClientRequest priorKnowledge(boolean priorKnowledge)
      Configure prior knowledge of HTTP/2 (e.g. we know the server supports it and we do not need to handle upgrade).
      Parameters:
      priorKnowledge - set to true to skip HTTP/1.1 upgrade process and use prior knowledge
      Returns:
      updated request
    • requestPrefetch

      Http2ClientRequest requestPrefetch(int requestPrefetch)
      Configure request prefetch, increases both connection and stream inbound flow control window and may send window updates to inform the server, depending on flow control strategy.
      Parameters:
      requestPrefetch - inbound flow control window increment in bytes
      Returns:
      updated request
    • flowControlTimeout

      Http2ClientRequest flowControlTimeout(Duration timeout)
      Outbound flow control blocking timeout.
      Parameters:
      timeout - duration
      Returns:
      updated request
    • request

      default Http2ClientResponse request()
      Description copied from interface: ClientRequest
      Request without an entity.
      Specified by:
      request in interface ClientRequest<Http2ClientRequest>
      Returns:
      response
    • submit

      Http2ClientResponse submit(Object entity)
      Description copied from interface: ClientRequest
      Submit an entity. For HTTP/1.1 streamed entities, entity writing can run on a helper virtual thread using the current Helidon context. This includes InstanceWriter.write(java.io.OutputStream) and EntityWriter implementations without instance-writer support. 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. Writers must release owned resources when output fails. Custom writers must not assume caller-thread affinity or propagation of arbitrary thread-local state.
      Specified by:
      submit in interface ClientRequest<Http2ClientRequest>
      Parameters:
      entity - request entity
      Returns:
      response
    • outputStream

      Http2ClientResponse outputStream(ClientRequest.OutputStreamHandler outputStreamConsumer)
      Description copied from interface: ClientRequest
      Handle output stream and submit the request. For HTTP/1.1, request headers are sent before invoking the handler when negotiating Expect: 100-continue. 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 HTTP/1.1 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. Account for both bypass and replay when the handler has side effects or consumes a one-shot source.

      Specified by:
      outputStream in interface ClientRequest<Http2ClientRequest>
      Parameters:
      outputStreamConsumer - handler that writes and closes the request output stream
      Returns:
      response