1OpenFrame::Response(3)User Contributed Perl DocumentationOpenFrame::Response(3)
2
3
4
6 OpenFrame::Response - An abstract response class
7
9 use OpenFrame;
10 use OpenFrame::Constants;
11 my $r = OpenFrame::Response->new();
12 $r->message("<html><body>Hello world!</body></html>");
13 $r->mimetype('text/html');
14 $r->code(ofOK);
15 $r->cookies(OpenFrame::Cookies->new());
16
18 "OpenFrame::Response" represents responses inside OpenFrame. Responses
19 represent some kind of response following a request for information.
20
21 This module abstracts the way clients can respond with data from
22 OpenFrame.
23
25 new()
26 This method creates a new "OpenFrame::Response" object. It takes no
27 parameters.
28
29 cookies()
30 This method gets and sets the "OpenFrame::Cookietin" that is associated
31 with this response.
32
33 my $cookietin = $r->cookies();
34 $r->cookies(OpenFrame::Cookies->new());
35
36 message()
37 This method gets and sets the message string associated with this
38 response. A scalar reference can be stored. It will always be returned
39 as a scalar.
40
41 my $message = $r->message();
42 $r->message("<html><body>Hello world!</body></html>");
43
44 code()
45 This method gets and sets the message code associated with this
46 response. The following message codes are exported when you use
47 "OpenFrame::Constants": ofOK, ofERROR, ofREDIRECT, ofDECLINE.
48
49 my $code = $r->code();
50 $r->code(ofOK);
51
52 mimetype()
53 This method gets and sets the MIME type associated with this response.
54
55 my $type = $r->mimetype();
56 $r->mimetype('text/html');
57
59 James Duncan <jduncan@fotango.com>
60
61
62
63perl v5.34.0 2021-07-22 OpenFrame::Response(3)