object
http_client_core
Portable stream-based HTTP client core predicates.
logtalk_load(http_client_core(loader))static, context_switching_calls
Binary streams: All stream predicates expect binary input and output streams.
Per-message primitives: The
write_request/2,read_response/2, andexchange/4predicates process a single HTTP exchange.Connection sequence: The
exchange_sequence/4predicate performs sequential exchanges on the same stream pair while HTTP persistence rules allow it.
Public predicates
write_request/2
Writes exactly one normalized HTTP request term to a binary stream.
staticwrite_request(Output,Request)write_request(+stream,+compound) - one_or_errorRequest is not a valid normalized HTTP request term:domain_error(http_request,Request)domain_error(http_header_semantics,Header)domain_error(http_property_semantics,Property)read_response/2
Reads exactly one HTTP response from a binary stream and returns it as a normalized response term. Fails on clean end-of-file before reading any bytes. Responses may be status-bodyless, Content-Length framed, Transfer-Encoding chunked, or close-delimited by end-of-file. Close-delimited responses are annotated with a body_framing(close_delimited) property.
staticread_response(Input,Response)read_response(+stream,--compound) - zero_or_onedomain_error(http_response_stream,malformed_response(Bytes))exchange/4
Writes one normalized request to a binary output stream and then reads one normalized response from a binary input stream.
staticexchange(Input,Output,Request,Response)exchange(+stream,+stream,+compound,--compound) - one_or_errorRequest is not a valid normalized HTTP request term:domain_error(http_request,Request)domain_error(http_header_semantics,Header)domain_error(http_property_semantics,Property)domain_error(http_response_stream,unexpected_end_of_file)domain_error(http_response_stream,malformed_status_line(Bytes))domain_error(http_response_stream,unsupported_transfer_encoding(Encodings))domain_error(http_response_stream,invalid_line_ending(CarriageReturn,LineFeed))domain_error(http_response_stream,bare_line_feed)domain_error(http_response_stream,malformed_response(Bytes))domain_error(non_negative_integer,Length)exchange_sequence/4
Performs a sequence of request-response exchanges on the same binary stream pair. If additional requests remain when HTTP persistence rules require connection closure, an error is thrown.
staticexchange_sequence(Input,Output,Requests,Responses)exchange_sequence(+stream,+stream,++list(compound),--list(compound)) - one_or_errorRequests is not a valid list of normalized HTTP request terms:domain_error(http_client_connection,Requests)Requests is not a valid normalized HTTP request term:domain_error(http_request,Request)domain_error(http_client_connection,remaining_requests(Requests))Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)