view release on metacpan or search on metacpan
docs/Merge.html view on Meta::CPAN
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML::Merge - Embedded HTML/SQL/Perl system.</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Object/XQuery.pod view on Meta::CPAN
=item * C<contentType>
String. By default C<application/x-www-form-urlencoded; charset=UTF-8>
When sending data to the server, use this content type. Default is C<application/x-www-form-urlencoded; charset=UTF-8>, which is fine for most cases. If you explicitly pass in a content-type to C<ajax>(), then it is always sent to the server (even if...
=item * C<context>
This option is not used.
lib/HTML/Object/XQuery.pod view on Meta::CPAN
=item * C<processData>
The way the data is handled depends on their nature, i.e. whether it is an hash reference, or an array reference or a regular string.
By default, data passed in to the data option as an hash reference or array reference (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type C<application/x-www-form-urle...
=item * C<scriptAttrs>
This option is not used.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Perlinfo.pm view on Meta::CPAN
Displaying detailed server information on the internet is not a good idea and HTML::Perlinfo reveals a lot of information about the local environment. While restricting what system users can publish online is wise, you can also hinder them from using...
=head1 NOTES
1. Print the content-type header first if you are using the module in a CGI setting. (mod_perl handles this for you automatically.) If you do not print the header, you will produce an internal server error. Of course, you can forgo a Web server entir...
2. If the HTML takes too long to load in the browser, then you can try flushing the output buffer. By flushing the buffer, the HTML will start appearing immediately.
INFO_APACHE relies soley on environment variables. If you don't use Apache, there is nothing to worry about. You do not need to turn INFO_APACHE off or anything. The section will simply not appear. Any Web server information will still be in the envi...
INFO_VARIABLES did not work correctly until version 1.52.
INFO_LOADED is the only option whose output cannot be assigned to a scalar.
Since the module outputs HTML, you may want to use it in a CGI script, but you do not have to. Of course, some information, like HTTP headers, would not be available if you use the module at the command-line. If you decide to use this module in a CGI...
use HTML::Perlinfo;
print "Content-type: text/html\n\n";
perlinfo();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Robot/Scrapper/UserAgent/Default.pm view on Meta::CPAN
my $content_types_avail = $self->robot->parser->content_types;
#set headers
$self->headers( $res->{ headers } );
$self->response_headers( $res->{ headers } );
#content type
my $content_type =$res->{headers}->{'content-type'};
$self->content_type( $content_type );
#charset
my $content_charset = $self->charset_from_headers( $res->{ headers } );
$self->charset( $content_charset );
lib/HTML/Robot/Scrapper/UserAgent/Default.pm view on Meta::CPAN
$content_type_found = 1;
}
}
print "**** Content type not set for: " . $content_type . '... please configure it correctly adding a parser for that content type'."\n" if !$content_type_found;
# foreach my $ct ( keys $self->parser_content_type ) {
# if ( $self->response->{ headers }->{'content-type'} =~ m|^$ct|g ) {
# my $parser_method = $self->parser_methods->{ $self->parser_content_type->{ $ct } };
# $self->$parser_method();
# }
# }
# my $reader_method = $item->{method};
# $self->$reader_method; #redirects back to method
}
sub charset_from_headers {
my ( $self, $headers ) = @_;
my $ct = $headers->{'content-type'};
my $charset ;
if ( $ct =~ m/charset=([^;|^ ]+)/ig ) {
$charset = $1;
}
return $charset;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Seamstress/Quickstart.html view on Meta::CPAN
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML::Seamstress::Quickstart - A gentle introduction to HTML::Seamstress</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:rurban@x-ray.at" />
</head>
<body style="background-color: white">
view all matches for this distribution
view release on metacpan or search on metacpan
examples/tags/tags.pl view on Meta::CPAN
my $html = <<HTML;
<html>
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html" />
<link type="text/css" rel="stylesheet" href="/styles.css" />
</head>
<body>
Some text
</body>
view all matches for this distribution
view release on metacpan or search on metacpan
etc/euc.html view on Meta::CPAN
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=x-sjis">
<title>O'Reilly Japan Home Page</title>
</head>
<body background="graphics/back_tile.gif" bgcolor="white">
<table border="0" width="690">
view all matches for this distribution
view release on metacpan or search on metacpan
Examples.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>HTML::TableTiler - Examples</title>
</head>
<body bgcolor="#ffffff">
<h1>HTML::TableTiler - Examples</h1>
<p>The examples below show you some possibilities of <b>HTML::TableTiler</b> module.</p>
view all matches for this distribution
view release on metacpan or search on metacpan
t/sample/index-e.html view on Meta::CPAN
<li><a href="http://www.kawa.net/works/ajax/rss/rss-box-e.html">
RSS BOX in your website </a><br />
How to put a RSS BOX in your website.
</li>
<li><a href="http://www.kawa.net/works/ajax/tips/mimetype/content-type-e.html">
Content-Type: availablity on XMLHttpRequest </a><br />
Some of content-types are only available on many browsers' XMLHttpRequest.
</li>
<li><a href="http://www.kawa.net/works/ajax/tips/dump/dom-tree.html">
Expanding DOM tree (cross browser DOM inspector)</a><br />
I found a bug in XML parsing engines of
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/TagTree.pm view on Meta::CPAN
}
}
);
sub get_default_head_meta_attributes{
my $attributes = 'http-equiv="content-type" content="text/html; charset=UTF-8"';
return $attributes;
}
sub get_http_header {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Tidy/libXML.pm view on Meta::CPAN
my $lx = XML::LibXML->new;
$lx->recover_silently(1);
my $dom = $lx->parse_html_string($string);
Except one major difference. L<HTML::Tidy::LibXML> does not trust
C<< <meta http-equiv="content-type" content="text/html; charset="foo"> >>
while L<XML::LibXML> tries to use one. Consider this;
my $dom = $lx->parse_html_string('http://example.com');
This B<kinda> works since L<XML::LibXML> is capable of fetching
view all matches for this distribution
view release on metacpan or search on metacpan
tidy-html5.c view on Meta::CPAN
TY_(InsertNodeAtStart)(head, currentNode);
}
continue;
}
/*
2. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
expected for HTML4. This is normally ok - but can clash.
*/
if (httpEquivAttr && !charsetAttr)
{
contentAttr = TY_(AttrGetById)(currentNode, TidyAttr_CONTENT);
tidy-html5.c view on Meta::CPAN
TY_(DiscardElement)(doc, currentNode);
currentNode = prevNode;
continue;
}
/* httpEquivAttrValue = TY_(tmbstrtolower)(httpEquivAttr->value); */
if (TY_(tmbstrcasecmp)(httpEquivAttr->value, (tmbstr) "content-type") != 0)
continue; /* is not 'content-type' */
if (!contentAttr->value)
{
continue; /* has no 'content' attribute has NO VALUE! */
}
/* check encoding matches
view all matches for this distribution
view release on metacpan or search on metacpan
Returns encoding id, if success. And returns HTML5::DOM::Encoding->NOT_DETERMINED if fail.
See for more info: L<https://html.spec.whatwg.org/multipage/syntax.html#prescan-a-byte-stream-to-determine-its-encoding>
my $encoding_id = HTML5::DOM::Encoding::detectByPrescanStream('
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
');
my $encoding = HTML5::DOM::Encoding::id2name($encoding_id);
print $encoding; # WINDOWS-1251
=head3 detectByCharset
And returns HTML5::DOM::Encoding->NOT_DETERMINED if fail.
See for more info: L<https://html.spec.whatwg.org/multipage/infrastructure.html#algorithm-for-extracting-a-character-encoding-from-a-meta-element>
my $encoding_id = HTML5::DOM::Encoding::detectByPrescanStream('
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
');
my $encoding = HTML5::DOM::Encoding::id2name($encoding_id);
print $encoding; # WINDOWS-1251
=head3 detectBomAndCut
view all matches for this distribution
view release on metacpan or search on metacpan
HTMLTMPL.pm view on Meta::CPAN
sub bailout()
{
my $mess = splice @_;
my($retVal) =<<HTML10;
content-type: text/html
<html><head></head>
<body bgcolor=red>
<p>
<font color=white>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/AnyUA.pm view on Meta::CPAN
return $self->request(POST => $url, {
%$args,
content => HTTP::AnyUA::Util::www_form_urlencode($data),
headers => {
%$headers,
'content-type' => 'application/x-www-form-urlencoded',
},
});
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Body.pm view on Meta::CPAN
return shift->{content_length};
}
=item content_type
Returns the content-type of the body data.
=cut
sub content_type {
return shift->{content_type};
view all matches for this distribution
view release on metacpan or search on metacpan
doc/html/Changes.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Changes</title>
<link rel="stylesheet" href="perldav.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Easy.pm view on Meta::CPAN
my $hash = HTTP::Easy::Headers->decode($h);
$hash->{connection}; # 'close'
$hash->{expect}; # 'continue-100'
$hash->{'content-type'}; # 'text/html'
my $hdr = HTTP::Easy::Headers->encode($hash);
use HTTP::Easy::Cookie;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Engine/Middleware/Encode.pm view on Meta::CPAN
before_handle {
my ( $c, $self, $req ) = @_;
my $encoding = $self->decode;
if ($self->detected_decode_by_header) {
if (( $req->headers->header('content-type') || '' ) =~ /charset\s*=\s*([^\s]+);?$/ ) {
$encoding = $1;
}
}
# decode parameters
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Engine/Interface/ModPerl.pm view on Meta::CPAN
$r->status( $res->status );
my $content_type;
$res->headers->scan(
sub {
my ($key, $val) = @_;
$content_type = $val if lc $key eq 'content-type';
$r->headers_out->add($key => $val);
}
);
$r->content_type($content_type) if $content_type;
},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Headers/ActionPack.pm view on Meta::CPAN
HTTP::Headers::ActionPack::WWWAuthenticate
];
my %DEFAULT_MAPPINGS = (
'link' => 'HTTP::Headers::ActionPack::LinkList',
'content-type' => 'HTTP::Headers::ActionPack::MediaType',
'accept' => 'HTTP::Headers::ActionPack::MediaTypeList',
'accept-charset' => 'HTTP::Headers::ActionPack::AcceptCharset',
'accept-encoding' => 'HTTP::Headers::ActionPack::PriorityList',
'accept-language' => 'HTTP::Headers::ActionPack::AcceptLanguage',
'date' => 'HTTP::Headers::ActionPack::DateHeader',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Headers/Fancy.pm view on Meta::CPAN
version 1.001
=head1 SYNOPSIS
my %fancy = decode_hash('content-type' => ..., 'x-foo-bar-baf-baz' => ...);
my $content_type = $fancy{ContentType};
my $x_foo_bar_baf_baz = $fancy{-FooBarBafBaz};
my %headers = encode_hash(ContentType => ..., -foo_bar => ...);
# %headers = ('content-type' => ..., 'x-foo-bar' => ...);
=head1 DESCRIPTION
This module provides method for renaming HTTP header keys to a lightier, easier-to-use format.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Headers/Fast.pm view on Meta::CPAN
# relative seconds and a positive value for epoch based time values.
#sub retry_after { shift->_date_header('Retry-After', @_); }
sub content_type {
my $self = shift;
my $ct = $self->{'content-type'};
$self->{'content-type'} = shift if @_;
$ct = $ct->[0] if ref($ct) eq 'ARRAY';
return '' unless defined($ct) && length($ct);
my @ct = split( /;\s*/, $ct, 2 );
for ( $ct[0] ) {
s/\s+//g;
lib/HTTP/Headers/Fast.pm view on Meta::CPAN
wantarray ? @ct : $ct[0];
}
sub content_type_charset {
my $self = shift;
my $h = $self->{'content-type'};
$h = $h->[0] if ref($h);
$h = "" unless defined $h;
my @v = _split_header_words($h);
if (@v) {
my($ct, undef, %ct_param) = @{$v[0]};
view all matches for this distribution
view release on metacpan or search on metacpan
- Fixed lowercase header bugs
- Thanks goes to contributed patches by various people
2.1.5 2003-10-05
- Fixed duplicate my in method()
- Added default content-type for posts
- header_at_once mode, patch submitted by Roman Radaschutz
2.1.3 2002-02-10
- Documentation fixes
- Fixed large write bug in http_write
1.0.1 2002-06-11
- Changed default protocol to HTTP/1.0 and added a switch to
activate HTTP/1.1 protocol.
1.0.0 2002-01-08
- Fixed bug where content-type was always set to only set it has not
yet been set.
Thanks to Rui Miguel Seabra <rms@multicert.com>
- Fixed bug where file descriptors were not being released by
request()
Thanks to Ross Snyder" <ross@newgrounds.com>
view all matches for this distribution
view release on metacpan or search on metacpan
Keys (header names) are converted to lower case.
Example:
{
'content-type' => ['text/html; charset=iso-8859-1'],
'connection' => ['close'],
'date' => ['Sun, 04 Jul 2010 18:21:12 GMT'],
'content-length' => ['217'],
'allow' => ['GET,HEAD,POST,OPTIONS,TRACE'],
'server' => ['Apache'],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Headers.pm view on Meta::CPAN
# relative seconds and a positive value for epoch based time values.
#sub retry_after { shift->_date_header('Retry-After', @_); }
sub content_type {
my $self = shift;
my $ct = $self->{'content-type'};
$self->{'content-type'} = shift if @_;
$ct = $ct->[0] if ref($ct) eq 'ARRAY';
return '' unless defined($ct) && length($ct);
my @ct = split(/;\s*/, $ct, 2);
for ($ct[0]) {
s/\s+//g;
lib/HTTP/Headers.pm view on Meta::CPAN
}
sub content_type_charset {
my $self = shift;
require HTTP::Headers::Util;
my $h = $self->{'content-type'};
$h = $h->[0] if ref($h);
$h = "" unless defined $h;
my @v = HTTP::Headers::Util::split_header_words($h);
if (@v) {
my($ct, undef, %ct_param) = @{$v[0]};
view all matches for this distribution
view release on metacpan or search on metacpan
t/04-header.t view on Meta::CPAN
'cseq' => '0009 INVITE',
'via' => 'SIP / 2.0 /UDP 192.0.2.2;branch=390skdjuw',
's' => '',
'newfangledheader' => 'newfangled value continued newfangled value',
'unknownheaderwithunusualvalue' => ';;,,;;,;',
'content-type' => 'application/sdp',
'route' => '<sip:services.example.com;lr;unknownwith=value;unknown-no-value>',
'v' => 'SIP / 2.0 / TCP spindle.example.com ; branch = z9hG4bK9ikj8 , SIP / 2.0 / UDP 192.168.255.111 ; branch= z9hG4bK30239',
'm' => '"Quoted string \"\"" <sip:jdrosen@example.com> ; newparam = newvalue ; secondparam ; q = 0.33',
];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Negotiate.pm view on Meta::CPAN
# specific than "text/html", which is more specific than "text/*",
# which in turn is more specific than "*/*"). If not media range
# in the provided Accept field matches the variant's media type,
# then the value assigned is "q=0".
if (exists $accept{'type'} && $ct) {
# First we clean up our content-type
$ct =~ s/\s+//g;
my $params = "";
$params = $1 if $ct =~ s/;(.*)//;
my($type, $subtype) = split("/", $ct, 2);
my %param = ();
lib/HTTP/Negotiate.pm view on Meta::CPAN
next if $at_type ne '*' && $at_type ne $type;
next if $at_subtype ne '*' && $at_subtype ne $subtype;
my $specificness = 0;
$specificness++ if $at_type ne '*';
$specificness++ if $at_subtype ne '*';
# Let's see if content-type parameters also match
while (($pk, $pv) = each %param) {
print "Check if $pk = $pv is true\n" if $DEBUG;
next unless exists $accept{'type'}{$at}{$pk};
next ACCEPT_TYPE
unless $accept{'type'}{$at}{$pk} eq $pv;
lib/HTTP/Negotiate.pm view on Meta::CPAN
- an original piece of ASCII-art may degrade in quality if it is
captured in JPEG form. The qs values should be assigned to each
variant by the content provider; if no qs value has been assigned, the
default is generally "qs=1".
=item content-type
This is the media type of the variant. The media type does not
include a charset attribute, but might contain other parameters.
Examples are:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Parser/XS.pm view on Meta::CPAN
# $ret is the length of the headers, starting the content body
# the other values are the response messages. For example:
# $status = 200
# $message = "OK"
# $headers = [ 'content-type' => 'text/html', ... ]
# and $special_headers{'content-length'} will be filled in
}
view all matches for this distribution
view release on metacpan or search on metacpan
if($result) {
skip "Didn't get response object", 3;
} else {
my $res = $parser->object;
isa_ok($res, 'HTTP::Response');
is($res->header('content-type'), 'text/plain', 'content type is correct');
is($res->content, "Some content!\x0d\x0a", 'content is correct');
}
# <1>
$parser = HTTP::Parser->new(request => 1);
view all matches for this distribution