2.1 library(http/http_open): HTTP client library
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog HTTP support
        • The HTTP client libraries
          • library(http/http_open): HTTP client library
            • http_open/3
            • map_method/2
            • disable_encoding_filter/1
            • http_set_authorization/2
            • open_hook/6
            • http_close_keep_alive/1
            • open_options/2
            • write_cookies/3
            • update_cookies/3
[nondet,multifile]http:open_options(+Parts, -Options)
This hook is used by the HTTP client library to define default options based on the the broken-down request-URL. The following example redirects all trafic, except for localhost over a proxy:
:- multifile
    http:open_options/2.

http:open_options(Parts, Options) :-
    option(host(Host), Parts),
    Host \== localhost,
    Options = [proxy('proxy.local', 3128)].

This hook may return multiple solutions. The returned options are combined using merge_options/3 where earlier solutions overrule later solutions.