object
http_server_core
Portable stream-based HTTP server orchestration predicates.
logtalk_load(http_server_core(loader))static, context_switching_callsPublic predicates
read_request/2
Reads exactly one HTTP request from a binary stream and returns it as a normalized request term. Fails on clean end-of-file before reading any bytes.
staticread_request(Input,Request)read_request(+stream,--compound) - zero_or_onewrite_response/2
Writes exactly one normalized HTTP response term to a binary stream.
staticwrite_response(Output,Response)write_response(+stream,+compound) - one_or_errorOutput is invalid for the delegated HTTP response generator:domain_error(http_sink,stream(Output))Response is not a valid normalized HTTP response term:domain_error(http_response,Response)domain_error(http_body_file_range,file(File,Offset,Length))dispatch/3
Dispatches a normalized HTTP request to a handler object implementing the http_handler_protocol protocol. Handler failures, exceptions, or invalid responses are converted to an internal server error response.
staticdispatch(Handler,Request,Response)dispatch(+object_identifier,+compound,-compound) - one_or_errorserve/3
Reads one request from a binary input stream, dispatches it to a handler object, and writes one response to a binary output stream. HEAD requests suppress response body bytes on the wire while preserving the generated response headers. Malformed requests are converted to bad request responses.
staticserve(Input,Output,Handler)serve(+stream,+stream,+object_identifier) - zero_or_oneserve_connection/3
Repeatedly reads requests from a binary input stream, dispatches them to a handler object, and writes responses to a binary output stream until end-of-file, a 101 Switching Protocols response, or connection-close semantics terminate the connection. HEAD requests suppress response body bytes on the wire while preserving the generated response headers.
staticserve_connection(Input,Output,Handler)serve_connection(+stream,+stream,+object_identifier) - one_or_errorHandler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)Output is invalid for the delegated HTTP response generator:domain_error(http_sink,stream(Output))domain_error(http_response,Response)domain_error(http_body_file_range,file(File,Offset,Length))accept_websocket/3
Validates a normalized WebSocket opening-handshake request and builds a matching 101 Switching Protocols response. The protocol(Protocol) option can be used to select a single offered subprotocol.
staticaccept_websocket(Request,Response,Options)accept_websocket(+compound,--compound,+list) - one_or_errorOptions contains an invalid WebSocket acceptance option:domain_error(http_server_core_websocket_option,Option)Options contains reserved WebSocket handshake headers:domain_error(http_server_core_websocket_headers,Headers)Options contains reserved WebSocket handshake properties:domain_error(http_server_core_websocket_properties,Properties)Request is not a valid normalized WebSocket opening-handshake request:domain_error(http_server_core_websocket_request,Request)Options selects a subprotocol not offered by Request:domain_error(http_server_core_websocket_protocol,Protocol)domain_error(http_response,Response)
Repeated options: When the same WebSocket acceptance option is given multiple times, the first occurrence is used.
serve_websocket/4
Reads one request from a binary input stream, dispatches it to a handler object, writes one response to a binary output stream, and returns accepted(Request, Response) when the exchange completed with a valid WebSocket opening-handshake response. Malformed requests and non-upgrade responses are written to the stream and reported as rejected(Response). Clean end-of-file before any bytes are read is reported as end_of_file.
staticserve_websocket(Input,Output,Handler,Outcome)serve_websocket(+stream,+stream,+object_identifier,--compound) - one_or_errorHandler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)Output is invalid for the delegated HTTP response generator:domain_error(http_sink,stream(Output))domain_error(http_response,Response)domain_error(http_body_file_range,file(File,Offset,Length))Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)