The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

NCGI::Singleton - Singleton object for NCGI

SYNOPSIS

  use NCGI::Query;
  my $q = NCGI::Query->new();

  if ($q->isquery) {
    print "GET\n" if $q->isget();
    print "POST\n" if $q->isget();
    print "Your submit button is called: ",$q->query->{'submit'};
  }

DESCRIPTION

NCGI::Query provides a simple HTTP Query object for use in the Rekudos framework. In most cases Rekudos Module authors will not need to use this module/object as NCGI::Main creates $NCGI::Globals::header for that purpose.

METHODS

new( ), new($content_type)

Create a new NCGI::Query object, optionally specifying a content type.

$header->status($status)

Set or get the string representing the status of the HTTP response. There is no validity checking when setting so you should read the HTTP specification for valid strings (eg '200 OK'). This has no default.

$header->content_type($type)

Set or get the string representing the Content-Type of the HTTP response. There is no validity checking when setting so you should read the HTTP/MIME specifications for valid strings. The default is 'text/html'.

$header->location($location)

Set or get the string representing the Location of a HTTP redirection. There is no validity checking when setting so you should read the HTTP specification for valid strings. This has no default.

$header->_as_string( )

Returns a string representation of the HTTP Query.

$header->_print( )

Print the HTTP header to STDOUT. Exactly the same as 'print $header->_as_string;'.

SEE ALSO

NCGI

AUTHOR

Mark Lawrence <nomad@null.net>

COPYRIGHT AND LICENSE

Copyright (C) 2005 Mark Lawrence <nomad@null.net>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.