view release on metacpan or search on metacpan
lib/CAM/SOAPApp.pm view on Meta::CPAN
# " It has not been tested with other SOAP::Lite versions.\n".
# " To silence this warning set\n".
# " $CAM::SOAPApp::NO_SOAP_LITE_WARNING = 1;\n");
#}
## Hack to repair content-type for clients who send the wrong
## value or no value (notably the Apple Sherlock 3 interface
## and Flash)
# This doesn't actually work for servers, but we'll include
#it in case SOAP::Lite ever gets fixed.
view all matches for this distribution
view release on metacpan or search on metacpan
This version is to extract out the app methods from CGI::Getopt class.
It was too much for CGI::Getopt to include the start_app, end_app,
build_html_header, and disp_form methods.
0.11 Rewrote start_app method so that content-type can be changed.
0.12 Moved disp_form to CGI::AppBuilder::Form,
moved build_html_header to CGI::AppBuilder::Header, and
imported all the methods in sub-classes into this class.
=item * Version 1.0001
view all matches for this distribution
view release on metacpan or search on metacpan
AppBuilder.pm view on Meta::CPAN
This version is to extract out the app methods from CGI::Getopt class.
It was too much for CGI::Getopt to include the start_app, end_app,
build_html_header, and disp_form methods.
0.11 Rewrote start_app method so that content-type can be changed.
0.12 Moved disp_form to CGI::AppBuilder::Form,
moved build_html_header to CGI::AppBuilder::Header, and
imported all the methods in sub-classes into this class.
=item * Version 1.0001
view all matches for this distribution
view release on metacpan or search on metacpan
client => sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => 'http://localhost/');
my $res = $cb->($req);
is $res->code, 200, 'status code is 200';
is $res->content_type, 'application/x-hello-world', 'content-type';
is $res->content, 'hello world', 'body';
};
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
caf_htdoc/index.html view on Meta::CPAN
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>CGI::Application::Framework</title>
<link rel="stylesheet" href="!!- url_example_css -!!" type="text/css" />
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
examples/PodViewer.pm view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>CGI::Application::Plugin::HTMLPrototype - PodViewer Example</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
[% c.prototype.define_javascript_functions %]
<link rel="stylesheet" href="http://search.cpan.org/s/style.css" type="text/css">
<style>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Plugin/Header.pm view on Meta::CPAN
Behaves like L<CGI::Application>'s C<header_props> method,
but the return format is modified. C<keys> of C<%header_props>
are lowercased and start with a dash. The following aliases are used:
'-content-type' -> '-type'
'-cookie' -> '-cookies'
It's guaranteed that the keys are unique.
=item $cgiapp->header_add( $k1 => $v1, $k2 => $v2, ... )
lib/CGI/Application/Plugin/Header.pm view on Meta::CPAN
use parent 'CGI::Header';
sub _build_alias {
+{
'cookies' => 'cookie',
'content-type' => 'type',
};
}
sub cookies {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Plugin/JSON.pm view on Meta::CPAN
$self->json_callback('alert', { foo => 'Lorem ipsum', bar => [ 0, 2, 3 ] } );
=head1 DESCRIPTION
When communicating with client-side JavaScript, it is common to send
data in C<X-JSON> HTTP headers or through the document body as content-type
C<application/json>.
This plugin adds a couple of convenience methods to make that just a
little bit easier.
lib/CGI/Application/Plugin/JSON.pm view on Meta::CPAN
=head1 BODY METHODS
=head2 json_body
This method will take the given Perl structure, turn it
into JSON, set the appropriate content-type, and then
return the JSON.
return $self->json_body({ foo => 'stuff', bar => [0,1,2,3]} );
=cut
lib/CGI/Application/Plugin/JSON.pm view on Meta::CPAN
}
=head2 json_callback
This method will take the given Perl structure, turn it
into JSON, set the appropriate content-type, and then
return a Javascript snippet where the given callback
is called with the resulting JSON.
return $self->json_callback('alert', { foo => 'stuff', bar => [0,1,2,3]} );
view all matches for this distribution
view release on metacpan or search on metacpan
share/examples/compare/Nes/index.nhtml view on Meta::CPAN
{: NES 1.0 ('index.cgi') :}
<html>
<html>
<head>
<title>Test Nes CGI::Application</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css">
#caja {
padding: 15px 15px 15px 15px;
border: 1px solid #dedede;
background: #eee;
view all matches for this distribution
view release on metacpan or search on metacpan
filename => 'members.csv',
stream => 1,
});
This method generates a csv file that is sent directly to the user's
web browser. It sets the content-type header to 'application/x-csv' and sets
the content-disposition header to 'attachment'.
It should be invoked through a
L<CGI::Application|CGI::Application(3)> subclass object.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Magic.pm view on Meta::CPAN
An auto-magically used template (it contains the 'ENV_table block', and the 'app_name' and 'Time' labels)
<html>
<head>
<meta http-equiv=content-type content="text/html;charset=iso-8859-1">
<title>ENVIRONMENT</title>
<style media=screen type=text/css><!--
td { font-size: 9pt; font-family: Arial }
--></style>
</head>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Buffer.pm view on Meta::CPAN
{
my $headers = shift;
foreach my $header (split(/\r?\n/, $headers)) {
my ($header_name, $header_value) = split /\:\s*/, $header, 2;
if (lc($header_name) eq 'content-type') {
@content_type = split /\//, $header_value, 2;
last;
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/tm/ENV_RM.html view on Meta::CPAN
<html>
<head>
<meta http-equiv=content-type content="text/html;charset=iso-8859-1">
<title>ENVIRONMENT</title>
<style media=screen type=text/css><!--
td { font-size: 9pt; font-family: Arial }
--></style>
</head>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Builder/Magic.pm view on Meta::CPAN
An auto-magically used template (it contains the 'ENV_table block', and the 'app_name' and 'Time' labels)
<html>
<head>
<meta http-equiv=content-type content="text/html;charset=iso-8859-1">
<title>ENVIRONMENT</title>
<style media=screen type=text/css><!--
td { font-size: 9pt; font-family: Arial }
--></style>
</head>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Builder/TT2.pm view on Meta::CPAN
Here's the template:
<html>
<head>
<meta http-equiv=content-type content="text/html;charset=iso-8859-1">
<title>A random example :)</title>
</head>
<body>
<table>
[% FOREACH k IN environment.keys %]
view all matches for this distribution
view release on metacpan or search on metacpan
CBF_examples/02_SimpleApp/SimpleApp.pm view on Meta::CPAN
; my $Time = $s->Time()
; $s->page_content = << "EOS"
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Index Page</title>
</head>
<body bgcolor="#ffffff">
<p>This page is the index (default) page of the application. </p>
CBF_examples/02_SimpleApp/SimpleApp.pm view on Meta::CPAN
; $err = $s->page_error
; $s->page_content = << "EOS"
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Password Page</title>
</head>
<body bgcolor="#ffffff">
<p>This page is a sort of simplified login page. By filling the 'password' field with the correct password you can go to the 'env_page', while you will have this page displayed again if the password is wrong.</p>
CBF_examples/02_SimpleApp/SimpleApp.pm view on Meta::CPAN
; my $Time = $s->Time()
; $s->page_content = << 'EOSTART'
<html>
<head>
<meta http-equiv=content-type content="text/html;charset=iso-8859-1">
<title>ENVIRONMENT</title>
<style media=screen type=text/css><!--
td { font-size: 9pt; font-family: Arial }
tr { vertical-align: top }
--></style>
CBF_examples/02_SimpleApp/SimpleApp.pm view on Meta::CPAN
{ my $s = shift
; $s->page_content = << "EOS"
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Unknown page!</title>
</head>
<body bgcolor="#ffffff">
<h1>Unknown page!</h1>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Compress/Gzip.pm view on Meta::CPAN
$content_type ||= 'text/html';
if (!$self->isCompressibleType($content_type))
{
# Not compressible media
return (0, 'incompatible content-type ' . $content_type);
}
# Check that IO::Zlib is available
if (!defined $global_can_compress)
{
view all matches for this distribution
view release on metacpan or search on metacpan
if( $$ofr =~ m/\G[ \t]+($nctl)$lcrlf/gmco )
{
$val .= $1;
next;
}
if( $name =~ m/content-type/i )
{
$content = 'text/html' if $val=~ m/\btext\/html\b/sio;
$content = 'text/plain' if $val=~ m/\btext\/plain\b/sio;
}
Import: header => 'control'
Controls that the HTTP-header is correct.
This control will follow the HTTP RFC to the point. It reports if the
header is ok, if the content-type is text/html, and the length of the
HTTP-body. That information will be used by other parts of
CGI::Debug. This is done by redirecting STDOUT to a temporary file.
This is the only control that must be set in the beginning of the
program. All other controls can be changed during before the end of
the program.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Easy/Headers.pm view on Meta::CPAN
While you're free to add/modify/delete any fields in this object/hash,
HTTP headers is case-insensitive, and thus it's possible to accidentally
create different keys in this hash for same HTTP header:
$h->{'Content-Type'} = 'text/plain';
$h->{'content-type'} = 'image/png';
To protect against this, compose() allow only keys named in 'Content-Type'
way and will throw exception if it found keys named in other way. There
few exceptions from this rule: 'ETag', 'WWW-Authenticate' and 'Digest-MD5'.
view all matches for this distribution
view release on metacpan or search on metacpan
200,
[
'Content-Type' => 'text/html; charset=utf-8',
],
],
'the responder should get a 200 status and content-type header',
);
$post_fh = select;
is($post_fh,$fh,'SelectSaver worked after headers');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Ex.pm view on Meta::CPAN
in itself as the hash.
=item C<-E<gt>content_type>
Can be called multiple times during the same session. Will only
print content-type once. (Useful if you don't know if something
else already printed content-type). Calling this sends the Content-type
header. Trying to print -E<gt>content_type is an error. For clarity,
the method -E<gt>print_content_type is available.
$cgix->print_content_type;
lib/CGI/Ex.pm view on Meta::CPAN
Arguments are the same as those to CGI->new->cookie({}).
Uses CGI's cookie method to create a cookie, but then, depending on
if content has already been sent to the browser will either print
a Set-cookie header, or will add a <meta http-equiv='set-cookie'>
tag (this is supported on most major browsers). This is useful if
you don't know if something else already printed content-type.
=item C<-E<gt>location_bounce>
Depending on if content has already been sent to the browser will either print
a Location header, or will add a <meta http-equiv='refresh'>
tag (this is supported on all major browsers). This is useful if
you don't know if something else already printed content-type. Takes
single argument of a url.
=item C<-E<gt>last_modified>
Depending on if content has already been sent to the browser will either print
a Last-Modified header, or will add a <meta http-equiv='Last-Modified'>
tag (this is supported on most major browsers). This is useful if
you don't know if something else already printed content-type. Takes an
argument of either a time (may be a CGI -expires style time) or a filename.
=item C<-E<gt>expires>
Depending on if content has already been sent to the browser will either print
a Expires header, or will add a <meta http-equiv='Expires'>
tag (this is supported on most major browsers). This is useful if
you don't know if something else already printed content-type. Takes an
argument of a time (may be a CGI -expires style time).
=item C<-E<gt>send_status>
Send a custom status. Works in both CGI and mod_perl. Arguments are
view all matches for this distribution
view release on metacpan or search on metacpan
t/00_internal.t view on Meta::CPAN
my @have = hash_sort $c->_munge_headers('content/foo', '123 blah', 42);
is_deeply \@have, \@want, "First form"
or diag explain "Want:", \@want, "Have:", \@have;
# Second CGI-like form, content-type override
@want = hash_sort (
'-type' => 'content/foo',
'-content_length' => 123,
'-charset' => 'utf-8',
'-status' => '321 bleh',
t/00_internal.t view on Meta::CPAN
);
is_deeply \@have, \@want, "Second form",
or diag explain "Want:", \@want, "Have:", \@have;
# Third CGI-like form, both content-type and status are overridden
@want = hash_sort (
'-type' => 'content/foo',
'-content_length' => 321,
'-charset' => 'utf-8',
'-status' => '111 blerg',
view all matches for this distribution
view release on metacpan or search on metacpan
t/2a-test04.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<!-- JavaScript validation code -->
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Framework.pm view on Meta::CPAN
=item return_template($scalar)
This method accepts a scalar template name, and returns the content parsed from that template suitable for sending to the client. Internally it takes care of language substitution, and the <cgi_framework_header>, <cgi_framework_footer> tags.
In scalar context it returns the content suitable for sending to the client. In array context it returns the content and the content-type.
=item session($scalar [, $scalar])
This method accepts a scalar key as it's first argument and an optional scalar value as it's second. If a value is supplied, it saves the key+value pair into the session for future retrieval. If no value is supplied, it returns the previously-saved...
lib/CGI/Framework.pm view on Meta::CPAN
}
#
# Takes a template name
# returns scalar output string containing parsed template, with lang and tags substitution
# In array mode also returns a second element which is the content-type
#
sub return_template {
my $self = _getself(\@_);
my $template_name = shift || croak "Template name not supplied";
my $template;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/lib/CGI/Redirect.pm view on Meta::CPAN
$self;
}
sub _build_alias {
+{
'content-type' => 'type',
'cookie' => 'cookies',
'uri' => 'location',
'url' => 'location',
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
bin/testjson.pl view on Meta::CPAN
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new(POST => 'https://localhost/cgi-bin/info.pl');
$req->header('content-type' => 'application/json');
$req->content('{ "first": "Nigel", "last": "Horne" }');
my $resp = $ua->request($req);
if($resp->is_success()) {
print "Reply:\n\t", $resp->decoded_content, "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Inspect/htdocs/js/jquery.js view on Meta::CPAN
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/JSONRPC/Base.js view on Meta::CPAN
if (hdrName != null) {
this._headers[this._headers.length] = {h:hdrName, v:hdrValue};
switch (hdrName.toLowerCase()) {
case 'content-encoding': gotContentEncoding = true; break;
case 'content-length' : gotContentLength = true; break;
case 'content-type' : gotContentType = true; break;
case 'date' : gotDate = true; break;
case 'expires' : gotExpiration = true; break;
case 'last-modified' : gotLastModified = true; break;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/OptimalQuery/SaveSearchTool.pm view on Meta::CPAN
my %email = (
to => $$rec{email_to},
from => $$rec{email_from} || $opts{email_from},
'Reply-To' => $$rec{'email_Reply-To'} || $opts{'email_Reply-To'},
subject => "$$rec{OQ_TITLE} - $$rec{USER_TITLE}",
'content-type' => 'text/html; charset="iso-8859-1"'
);
$email{subject} .= " ($total_new added)" if $total_new > 0;
$email{body} =
"<html>
view all matches for this distribution
view release on metacpan or search on metacpan
last METHOD;
}
# Process XForms postings. We know that we have XForms in the
# following cases:
# method eq 'POST' && content-type eq 'application/xml'
# method eq 'POST' && content-type =~ /multipart\/related.+start=/
# There are more cases, actually, but for now, we don't support other
# methods for XForm posts.
# In a XForm POST, the QUERY_STRING is parsed normally.
# If the content-type is 'application/xml', we just set the param
# XForms:Model (referring to the xml syntax) param containing the
# unparsed XML data.
# In the case of multipart/related we set XForms:Model as above, but
# the other parts are available as uploads with the Content-ID as the
# the key.
view all matches for this distribution