Skip to contents

RhoHttpRequest is a typed request value. HttpClient requires rho_http_send() and rho_http_open_stream(). The latter resolves to a RhoHttpBodyStream after the response head arrives. RhoSseDecoder preserves protocol state across arbitrary byte chunks. rho_sse_connect() is the default composition over any RhoHttpClient implementation and exposes decoded RhoSseEvent values through the common Rho stream protocol. WebSocketClient is deliberately separate: an HTTP client does not imply that it can open a WebSocket. rho_ws_connect() resolves to a RhoWebSocket, an asynchronous duplex whose inbound values use the common stream protocol.

Details

rho_http_client() constructs the built-in RhoNanonextHttpClient. Its TLS configuration is created in memory by nanonext::tls_config(); this package does not search the host filesystem for certificate bundles. Another client subclasses RhoHttpClient, implements HttpClient, and returns its own RhoHttpBodyStream subclass with stream-next and close methods. Providers and SSE decoding do not depend on its connection handle.

rho_http_open_execution() reports where response-head opening runs. The built-in client returns RhoHttpAioOpen; a worker-owned implementation may return RhoHttpWorkerOpen. The inherited RhoHttpClient method deliberately returns RhoHttpCallerOpen until a subclass declares asynchronous opening. The latter records that constructing the response stream may occupy the calling R process even though later body reads are asynchronous.