| | 15 | |
| | 16 | __END__ |
| | 17 | |
| | 18 | =head1 NAME |
| | 19 | |
| | 20 | HTTP::Engine::Role::Interface - The Interface Role Definition |
| | 21 | |
| | 22 | =head1 SYNOPSIS |
| | 23 | |
| | 24 | package HTTP::Engine::Interface::CGI; |
| | 25 | use Moose; |
| | 26 | with 'HTTP::Engine::Role::Interface'; |
| | 27 | |
| | 28 | =head1 DESCRIPTION |
| | 29 | |
| | 30 | HTTP::Engine::Role::Interface defines the role of an interface in HTTP::Engine. |
| | 31 | |
| | 32 | Specifically, an Interface in HTTP::Engine needs to do at least two things: |
| | 33 | |
| | 34 | =over 4 |
| | 35 | |
| | 36 | =item Create a HTTP::Engine::Request object from the client request |
| | 37 | |
| | 38 | If you are on a CGI environment, you need to receive all the data from |
| | 39 | %ENV and such. If you are running on a mod_perl process, you need to muck |
| | 40 | with $r. |
| | 41 | |
| | 42 | In any case, you need to construct a valid HTTP::Engine::Request object |
| | 43 | so the application handler can do the real work. |
| | 44 | |
| | 45 | =item Accept a HTTP::Engine::Response object, send it back to the client |
| | 46 | |
| | 47 | The application handler must return an HTTP::Engine::Response object. |
| | 48 | |
| | 49 | In turn, the interface needs to do whatever necessary to present this |
| | 50 | object to the client. In a CGI environment, you would write to STDOUT. |
| | 51 | In mod_perl, you need to call the appropriate $r->headers methods and/or |
| | 52 | $r->print |
| | 53 | |
| | 54 | =back |
| | 55 | |
| | 56 | =cut |