]> gitweb.factorcode.org Git - factor.git/blob - basis/http/server/responses/responses-docs.factor
merge project-euler.factor
[factor.git] / basis / http / server / responses / responses-docs.factor
1 USING: help.markup help.syntax io.streams.string strings
2 http math ;
3 IN: http.server.responses
4
5 HELP: <content>
6 { $values { "body" "a response body" } { "content-type" string } { "response" response } }
7 { $description "Creates a successful HTTP response which sends a response body with the specified content type to the client." } ;
8
9 HELP: <trivial-response>
10 { $values { "code" integer } { "message" string } { "response" response } }
11 { $description "Creates an HTTP error response." }
12 { $examples
13     { $code
14         "USE: http.server.responses"
15         "415 \"Unsupported Media Type\" <trivial-response>"
16     }
17 } ;
18
19 ARTICLE: "http.server.responses" "Canned HTTP responses"
20 "The " { $vocab-link "http.server.responses" } " vocabulary provides constructors for a few useful " { $link response } " objects."
21 { $subsections
22     <content>
23     <304>
24     <403>
25     <400>
26     <404>
27 }
28 "New error responses like the above can be created for other error codes too:"
29 { $subsections <trivial-response> } ;
30
31 ABOUT: "http.server.responses"