]> gitweb.factorcode.org Git - factor.git/blob - basis/http/server/redirection/redirection-docs.factor
docs: change $subsection to $subsections
[factor.git] / basis / http / server / redirection / redirection-docs.factor
1 USING: help.markup help.syntax urls strings http ;
2 IN: http.server.redirection
3
4 HELP: relative-to-request
5 { $values { "url" "a " { $link url } " or " { $link string } } { "url'" "a " { $link url } " or " { $link string } } }
6 { $description "If the input is a relative " { $link url } ", makes it an absolute URL by resolving it to the current request's URL. If the input is a string, does nothing." } ;
7
8 HELP: <permanent-redirect>
9 { $values { "url" "a " { $link url } " or " { $link string } } { "response" response } }
10 { $description "Redirects to the user to the URL after applying " { $link relative-to-request } "." }
11 { $notes "This redirect type should always be used with POST requests, and with GET requests in cases where the new URL always supercedes the old one. This is due to browsers caching the new URL with permanent redirects." } ;
12
13 HELP: <temporary-redirect>
14 { $values { "url" "a " { $link url } " or " { $link string } } { "response" response } }
15 { $description "Redirects to the user to the URL after applying " { $link relative-to-request } "." }
16 { $notes "This redirect type should be used with GET requests where the new URL does not always supercede the old one. Use from POST requests with care, since this will cause the browser to resubmit the form to the new URL." } ;
17
18 ARTICLE: "http.server.redirection" "HTTP responder redirection"
19 "The " { $vocab-link "http.server.redirection" } " defines some " { $link response } " types which redirect the user's client to a new page."
20 { $subsections
21     <permanent-redirect>
22     <temporary-redirect>
23 }
24 "A utility used by the above:"
25 { $subsections relative-to-request }
26 "The " { $vocab-link "furnace.redirection" } " vocabulary provides a higher-level implementation of this. The " { $vocab-link "furnace.conversations" } " vocabulary allows state to be maintained between redirects." ;
27
28 ABOUT: "http.server.redirection"