:- use_module(library(http/http_wrapper)).
http_wrapper(:Goal,
+In, +Out, -Connection, +Options)’Keep-alive’ if both ends of the connection
want to continue the connection or close if either side
wishes to close the connection.
This predicate reads an HTTP request-header from In,
redirects current output to a memory file and then runs call(Goal,
Request), watching for exceptions and failure. If Goal
executes successfully it generates a complete reply from the created
output. Otherwise it generates an HTTP server error with additional
context information derived from the exception.
http_wrapper/5 supports the following options: