3.2 library(http/http_dispatch): Dispatch requests in the HTTP server
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog HTTP support
        • The HTTP server libraries
          • library(http/http_dispatch): Dispatch requests in the HTTP server
            • http_handler/3
            • http_delete_handler/1
            • http_dispatch/1
            • http_request_expansion/2
            • http_current_handler/2
            • http_current_handler/3
            • http_location_by_id/2
            • http_link_to_id/3
            • http_reload_with_parameters/3
            • http_reply_file/3
            • http_safe_file/2
            • http_redirect/3
            • http_404/2
            • http_switch_protocol/2
Availability::- use_module(library(http/http_dispatch)).
Source[det]http_redirect(+How, +To, +Request)
Redirect to a new location. The argument order, using the Request as last argument, allows for calling this directly from the handler declaration:
:- http_handler(root(.),
                http_redirect(moved, myapp('index.html')),
                []).
How is one of moved, moved_temporary or see_other
To is an atom, a aliased path as defined by http_absolute_location/3. or a term location_by_id(Id) or its abbreviations #(Id) or #(Id)+Parameters. If To is not absolute, it is resolved relative to the current location.