1 USING: help.markup help.syntax io.streams.string strings
2 http math furnace.json ;
3 IN: http.server.responses
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." } ;
10 { $values { "body" "a response body" } { "response" response } }
11 { $description "Creates a response with content type " { $snippet "text/plain" } "." } ;
14 { $values { "body" "a response body" } { "response" response } }
15 { $description "Creates a response with content type " { $snippet "text/html" } "." } ;
17 { <content> <text-content> <html-content> } related-words
19 HELP: <trivial-response>
20 { $values { "code" integer } { "message" string } { "response" response } }
21 { $description "Creates an HTTP error response." }
24 "USE: http.server.responses"
25 "415 \"Unsupported Media Type\" <trivial-response>"
29 ARTICLE: "http.server.responses" "Canned HTTP responses"
30 "The " { $vocab-link "http.server.responses" } " vocabulary provides constructors for a few useful " { $link response } " objects." $nl
31 "For successful responses:"
44 "New error responses like the above can be created for other error codes too:"
45 { $subsections <trivial-response> } ;
47 ABOUT: "http.server.responses"