Interface Http1ClientRequest

All Superinterfaces:
ClientRequest<Http1ClientRequest>

public interface Http1ClientRequest extends ClientRequest<Http1ClientRequest>
Client request for HTTP/1.1.
  • Method Details

    • submit

      Http1ClientResponse submit(Object entity)
      Submit the request with the provided entity. For streamed entities, an EntityWriter without 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:
      submit in interface ClientRequest<Http1ClientRequest>
      Parameters:
      entity - request entity
      Returns:
      response
    • request

      default Http1ClientResponse request()
      Description copied from interface: ClientRequest
      Request without an entity.
      Specified by:
      request in interface ClientRequest<Http1ClientRequest>
      Returns:
      response
    • outputStream

      Http1ClientResponse outputStream(ClientRequest.OutputStreamHandler outputStreamConsumer)
      Handle an output stream and submit this request. When negotiating Expect: 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:
      outputStream in interface ClientRequest<Http1ClientRequest>
      Parameters:
      outputStreamConsumer - handler that writes and closes the request output stream
      Returns:
      response
    • upgrade

      UpgradeResponse upgrade(String protocol)
      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