MKDoc::Core::Response - MKDoc Response object.


This object defines the response which is sent back to the client.

It is not mandatory to use it, but it is quite nice and convenient.



Returns the MKDoc::Core::Response singleton - or creates it if necessary.


Instanciates an MKDoc::Core::Response object from either a $string as returned by $self->get(), or @args which is a hash.

    my $response = new MKDoc::Core::Response
        Status       => '200 OK',
        Set-Cookie   => 'EvilCookie',
        Content-Type => 'text/plain',
        BODY         => 'Hello, World!';

    my $clone = new MKDoc::Core::Response ($response->get());


Returns the head of the HTTP query.


Returns the head plus the body of the HTTP query.


Setter / Getter for the response status code.

$self->Status ("404 Not Found");


Setter / Getter for the message body.


Setter / Getter for any other header.

Any other header can be set through the AUTOLOAD method. e.g.

    $self->X_Foo ("Bar");

Will automagically add the header:

    X-Foo: Bar


Outputs the response to STDOUT.


Copyright 2003 - MKDoc Holdings Ltd.

Author: Jean-Michel Hiver

This module is free software and is distributed under the same license as Perl itself. Use it at your own risk.


  L<Petal> TAL for perl

Help us open-source MKDoc. Join the mkdoc-modules mailing list: