view release on metacpan or search on metacpan
t/test-data/unicode.html view on Meta::CPAN
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
ð
</body>
</html>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Request/JSON.pm view on Meta::CPAN
{
self_destruct_mechanism => 'disabled',
users_allowed_to_override => [],
}
);
# Request content is JSON-encoded, and the content-type is set.
=head1 DESCRIPTION
This is a simple subclass of HTTP::Request that does two things.
First of all, it sets the Accept header to C<application/json> as soon
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LWP/MediaTypes.pm view on Meta::CPAN
if (exists $suffixEncoding{lc $_}) {
unshift(@encoding, $suffixEncoding{lc $_});
next;
}
# check content-type
if (exists $suffixType{$_}) {
$ct = $suffixType{$_};
last;
}
if (exists $suffixType{lc $_}) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LWP/Simple/Post.pm view on Meta::CPAN
=head2 post_xml
my $content = post_xml( string $url, string $data );
Having written this module, it turned out that 99% of what I needed it
for required a content-type of C<text/xml>. This does exactly what C<post>
does, only the content-type header is set to C<text/html>.
=cut
sub post_xml {
my ( $url, $data ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LWP/UserAgent/msgraph.pm view on Meta::CPAN
#Response code is a keeper
$self->{code}=$res->code;
if ($res->is_success) {
if ($res->header('content-type') =~ /^application\/json/) {
my $data=from_json($res->decoded_content);
#Here we save the nextLink for further use
if (exists $data->{'@odata.nextLink'}) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/lwpx-profile.tape view on Meta::CPAN
'accept-ranges' => 'none',
'client-peer' => '74.125.225.16:80',
'alternate-protocol' => '80:quic,p=0.08',
'vary' => 'Accept-Encoding',
'date' => 'Thu, 19 Feb 2015 15:09:55 GMT',
'content-type' => 'text/html; charset=ISO-8859-1',
'client-response-num' => 1,
'expires' => '-1',
'x-meta-description' => 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
'title' => 'Google',
'::std_case' => {
t/lwpx-profile.tape view on Meta::CPAN
'cache-control' => 'private, max-age=0',
'server' => 'gws',
'x-meta-robots' => 'noodp',
'x-xss-protection' => '1; mode=block',
'x-frame-options' => 'SAMEORIGIN',
'content-type' => 'text/html; charset=ISO-8859-1',
'client-response-num' => 1,
'vary' => 'Accept-Encoding',
'date' => 'Thu, 19 Feb 2015 15:09:55 GMT',
'expires' => '-1',
'x-meta-description' => 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
t/lwpx-profile.tape view on Meta::CPAN
'x-meta-description' => 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
'expires' => '-1',
'date' => 'Thu, 19 Feb 2015 15:09:55 GMT',
'vary' => 'Accept-Encoding',
'client-response-num' => 1,
'content-type' => 'text/html; charset=ISO-8859-1',
'client-peer' => '74.125.225.16:80',
'alternate-protocol' => '80:quic,p=0.08',
'accept-ranges' => 'none',
'set-cookie' => [
'PREF=ID=421e54fc3a1220ec:FF=0:TM=1424358595:LM=1424358595:S=vkkKNRlblQn2dpxq; expires=Sat, 18-Feb-2017 15:09:55 GMT; path=/; domain=.google.com',
t/lwpx-profile.tape view on Meta::CPAN
'cache-control' => 'private, max-age=0',
'server' => 'gws',
'x-meta-robots' => 'noodp',
'x-xss-protection' => '1; mode=block',
'x-frame-options' => 'SAMEORIGIN',
'content-type' => 'text/html; charset=ISO-8859-1',
'client-response-num' => 1,
'vary' => 'Accept-Encoding',
'date' => 'Thu, 19 Feb 2015 15:09:55 GMT',
'expires' => '-1',
'x-meta-description' => 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
t/lwpx-profile.tape view on Meta::CPAN
'cache-control' => 'private, max-age=0',
'server' => 'gws',
'x-meta-robots' => 'noodp',
'date' => 'Thu, 19 Feb 2015 15:09:55 GMT',
'vary' => 'Accept-Encoding',
'content-type' => 'text/html; charset=ISO-8859-1',
'client-response-num' => 1,
'expires' => '-1',
'x-meta-description' => 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
'accept-ranges' => 'none',
'client-peer' => '74.125.225.16:80',
t/lwpx-profile.tape view on Meta::CPAN
'x-meta-description' => 'The Perl Programming Language at Perl.org. Links and other helpful resources for new and experienced Perl programmers.',
'x-proxy' => 'proxy2',
'vary' => 'Accept-Encoding',
'date' => 'Thu, 19 Feb 2015 15:09:56 GMT',
'client-response-num' => 1,
'content-type' => 'text/html; charset=utf-8',
'age' => '0',
'client-peer' => '108.161.188.196:80',
'via' => '1.1 varnish'
}, 'HTTP::Headers' ),
'_msg' => 'OK'
view all matches for this distribution
view release on metacpan or search on metacpan
rc => 200
msg => OK
date => Wed, 24 Apr 2002 21:46:30 GMT
server => Apache/1.3.22
protocol => HTTP/1.1
content-type => text/plain
content-length => 92
last-modified => Wed, 24 Apr 2002 21:46:34 GMT
expires => Wed, 24 Apr 2002 21:47:04 GMT
connection => close
content => (complete text buffer)
unless $buffer;
return $rsp->{rc} . ' ' . $rsp->{msg}
unless parse_http_response(\$buffer,$rsp);
return 'invalid content-type ' . $rsp->{'content-type'}
unless $rsp->{'content-type'} =~ m|text/plain|i;
%$cnt = split(/[=\n]/,$rsp->{content});
return 'invalid data in short response'
unless exists $cnt->{LaBrea} &&
exists $cnt->{Tarpit} &&
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LaTeXML/Plugin/LtxMojo.pm view on Meta::CPAN
################################################
my $r = $app->routes;
$r->post('/convert' => sub {
my $self = shift;
my $type = $self->req->headers->header('x-file-type');
if ($type && $type =~ 'zip' && ($self->req->headers->header('content-type') eq 'multipart/form-data')) {
$self->convert_zip;
} else {
$self->convert_string;
}
});
lib/LaTeXML/Plugin/LtxMojo.pm view on Meta::CPAN
$r->post('/upload' => sub {
my $self = shift;
# TODO: Need a session?
my $type = $self->req->headers->header('x-file-type');
if ($type && $type =~ 'zip' && ($self->req->headers->header('content-type') eq 'multipart/form-data')) {
$self->convert_zip;
} else {
#.tex , .sty , .jpg and so on - write to filesystem (when are we done?)
$self->render(text=>"Uploaded, but ignored!");
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LaTeXML/resources/XSLT/LaTeXML-webpage-xhtml.xsl view on Meta::CPAN
<xsl:template match="/" mode="head">
<xsl:text>
</xsl:text>
<xsl:element name="head" namespace="{$html_ns}">
<xsl:apply-templates select="." mode="head-begin"/>
<xsl:apply-templates select="." mode="head-content-type"/>
<xsl:apply-templates select="." mode="head-title"/>
<xsl:apply-templates select="." mode="head-generator-identifier"/>
<xsl:apply-templates select="." mode="head-icon"/>
<xsl:apply-templates select="." mode="head-resources"/>
<xsl:apply-templates select="." mode="head-viewport"/>
lib/LaTeXML/resources/XSLT/LaTeXML-webpage-xhtml.xsl view on Meta::CPAN
<xsl:text>
</xsl:text>
</xsl:element>
</xsl:template>
<!-- Note: if you override the head-begin template in a plain HTML5 (non-XML)
document, you must ensure that the content of the head-content-type
declaration appears in full within the first 1024 bytes of the document,
or the output will not comply with the HTML5 standard.
-->
<xsl:template match="/" mode="head-begin"/>
<xsl:template match="/" mode="head-end"/>
lib/LaTeXML/resources/XSLT/LaTeXML-webpage-xhtml.xsl view on Meta::CPAN
<xsl:template match="/" mode="head-generator-identifier">
<xsl:text>
</xsl:text>
<xsl:call-template name="LaTeXML_identifier"/>
</xsl:template>
<!-- Generate a meta indicating the content-type -->
<xsl:template match="/" mode="head-content-type">
<xsl:text>
</xsl:text>
<xsl:choose>
<!-- HTML5 in XML syntax: content-type and charset not allowed -->
<xsl:when test="$USE_NAMESPACES='true' and $USE_HTML5='true'" />
<xsl:otherwise>
<xsl:element name="meta" namespace="{$html_ns}">
<!-- HTML(4|5) or XHTML1.1: content-type and charset -->
<xsl:attribute name="http-equiv">content-type</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="f:if($USE_NAMESPACES,'application/xhtml+xml','text/html')"/>
<xsl:text>; charset=UTF-8</xsl:text>
</xsl:attribute>
</xsl:element>
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/html/index.html view on Meta::CPAN
<?xml version="1.0"?>
<!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-gb" lang="en-gb">
<head>
<title>[% iname %]</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="refresh" content="0;url=/cgi-bin/pages.cgi" />
</head>
<body>
<p>1..2...1..2...check...check
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Langertha/Engine/AnthropicBase.pm view on Meta::CPAN
sub update_request {
my ( $self, $request ) = @_;
$request->header('x-api-key', $self->api_key);
$request->header('content-type', 'application/json');
$request->header('anthropic-version', $self->api_version);
}
sub default_model { croak "".(ref $_[0])." requires model to be set" }
view all matches for this distribution
view release on metacpan or search on metacpan
share/lisp/quoi/default_template.clp view on Meta::CPAN
(defmacro default-template [title xml]
`(fn [S]
#[html
^{:xmlns "http://www.w3.org/1999/xhtml"}
#[head
#[meta ^{:http-equiv "content-type" :content "text/html; charset=UTF-8"}]
#[meta ^{:name "description" :content ""}]
#[meta ^{:name "keywords" :content ""}]
#[title ~title]
#[script ^{:id "jquery"
:src "/javascripts/jquery-1.9.1.min.js"
view all matches for this distribution
view release on metacpan or search on metacpan
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
function serverRequest(config) {
var headers = config.headers;
var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);
// strip content-type if data is undefined
if (isUndefined(reqData)) {
forEach(headers, function(value, header) {
if (lowercase(header) === 'content-type') {
delete headers[header];
}
});
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Portal/Main/Display.pm view on Meta::CPAN
}
##@method public void printImage(string file, string type)
# Print image to STDOUT
# @param $file The path to the file to print
# @param $type The content-type to use (ie: image/png)
# @return void
sub staticFile {
my ( $self, $req, $file, $type ) = @_;
require Plack::Util;
require Cwd;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/Portal/Script.pm view on Meta::CPAN
}
sub add_header {
my $self = shift;
my $_line = shift;
my %STORE = ( 'content-type' => 1, );
my %TEST_STORE = (
'location' => "%LOCATION%",
'set-cookie' => "%SETCOOKIE%",
);
view all matches for this distribution
view release on metacpan or search on metacpan
doc/html/Jemplate.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>Jemplate - JavaScript Templating with Template Toolkit</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@omen.apple.com" />
</head>
<body style="background-color: white">
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Leyland/Negotiator.pm view on Meta::CPAN
return $all_routes unless my $ct = $c->content_type;
# will hold all routes with acceptable receive types
my $routes = [];
# remove charset from content-type
if ($ct =~ m/^([^;]+)/) {
$ct = $1;
}
$c->log->debug("I have received $ct");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Limper/Engine/PSGI.pm view on Meta::CPAN
(request->{scheme}, request->{authority}, request->{path}, request->{query}, request->{fragment}) =
request->{uri} =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|; # from https://metacpan.org/pod/URI
request->{headers} = {};
request->{headers}{'content-length'} = $env->{CONTENT_LENGTH} if exists $env->{CONTENT_LENGTH};
request->{headers}{'content-type'} = $env->{CONTENT_TYPE} if exists $env->{CONTENT_TYPE};
for my $header (grep { /^HTTP_/ } keys %$env) {
my $name = lc $header;
$name =~ s/^http_//;
$name =~ s/_/-/g;
my @values = split /, /, $env->{$header};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Limper/SendFile.pm view on Meta::CPAN
my $date = parse_date("Sunday, 06-Nov-94 08:49:37 GMT");
my $date = parse_date("Sun Nov 6 08:49:37 1994");
=head2 mime_types
Returns a B<HASH> of file extension / content-type pairs.
=head1 HOOKS
=head2 after
view all matches for this distribution
view release on metacpan or search on metacpan
docs/DetectLanguage.pl view on Meta::CPAN
#!/usr/bin/perl -w
require "Languages.inc"; # ïîëó÷èëè @AvailableLangs
my $AcceptLang=$ENV{HTTP_ACCEPT_LANGUAGE};
#print "content-type: text/html\n\n";
if ( $AcceptLang ) { # Åñëè ïåðåìåííàÿ HTTP-ACCEPT-LANGUAGE îò áðàóçåðà ïîëó÷åíà
# Ïåðåáèðàåì ñïèñîê @AvailableLangs è âûõîäèì, êàê òîëüêî íàòêíåìñÿ íà íóæíûé ÿçûê
for ( @{$AvailableLangs} ) {
if ($AcceptLang=~/$_/ ) { $DefaultLang=$_; last;}
view all matches for this distribution
view release on metacpan or search on metacpan
js/jquery/jquery-1.4.js view on Meta::CPAN
// Opera returns 0 when status is 304
return xhr.status === 304 || xhr.status === 0;
},
httpData: function( xhr, type, s ) {
var ct = xhr.getResponseHeader("content-type") || "",
xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.nodeName === "parsererror" ) {
throw "parsererror";
view all matches for this distribution
view release on metacpan or search on metacpan
loadworm.pl view on Meta::CPAN
return;
}
print "\n";
# We are done here, unless it is an HTML document . . .
unless ( ${$response}{'_headers'}{'_header'}{'content-type'}[0] eq "text/html" )
{print TIMING "\n"; return;}
# . . . then we must parse it, too.
($base, $html) = &ParseFile($response);
# I think that URI::URL::url() handles "func?..." wrong. It does not belong with the $BASE, so . . .
loadworm.pl view on Meta::CPAN
# $yyy = "";
# for $yy ( @y) { $yyy .= $yy.","; }
# chop $yyy;
# print "$_=".$yyy."\n";
# }
print ${$response}{'_headers'}{'_header'}{'content-type'}[0]."\n";
}
# Skip certain documents, well, just because!
view all matches for this distribution
view release on metacpan or search on metacpan
t/demo.po.pl view on Meta::CPAN
$VAR1 = [
{
'headers' => {
'last-translator' => 'Thomas Thurman <marnanel@cpan.org>',
'content-type' => 'text/plain; charset=UTF-8',
'language-team' => 'test <test@example.org>',
'po-revision-date' => '1975-01-30 00:00 +0000',
'mime-version' => '1.0',
'project-id-version' => 'Demo of a .po file',
'content-transfer-encoding' => '8bit'
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Dispatch/Email/Siffra.pm view on Meta::CPAN
Subject => $subject,
Data => $message,
Type => 'text/html; charset=UTF-8',
);
$msg->attr( 'content-type' => 'text/html' );
$msg->attr( 'content-type.charset' => 'UTF-8' );
$msg->send( 'smtp', $host, 'port', $port );
$log->info( "Email enviado com sucesso : host [ $host ] port [ $port ] subject [ $subject ]\n" );
} ## end sub send_email
=head3 C<flush()>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Report/Lexicon/MOTcompact.pm view on Meta::CPAN
unless(defined $charset)
{ $msgid_b eq ''
or error __x"the header is not the first entry, needed for charset in {fn}", fn => $fn;
$charset = $msgstr_b =~ m/^content-type:.*?charset=["']?([\w-]+)/mi ? $1
: error __x"cannot detect charset in {fn}", fn => $fn;
trace "auto-detected charset $charset for $fn";
$enc = find_encoding($charset)
view all matches for this distribution
view release on metacpan or search on metacpan
sample/us_constitution/index.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=UTF-8">
<link rel="stylesheet" type="text/css" href="uscon.css">
<title>US Constitution</title>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/mhn2mbox.pl view on Meta::CPAN
print MBOXFILE "Message-ID: <$href->{'message-id'}[0]>\n";
}
print MBOXFILE "MIME-Version: 1.0\n";
if (defined($href->{'content-type'})) {
$contype = $href->{'content-type'}[0];
} elsif (defined($href->{'contenttype'})) { # older versions
$contype = $href->{'contenttype'}[0];
}
if (defined($href->{'msgbodytext'})) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MIME/BodyMunger.pm view on Meta::CPAN
my ($self, $entity, $code) = @_;
Carp::confess "rewrite_content called on non-text part"
unless $entity->effective_type =~ qr{\Atext/(?:html|plain)(?:$|;)}i;
my $charset = $entity->head->mime_attr('content-type.charset')
|| 'ISO-8859-1';
$charset = 'MacRoman' if lc $charset eq 'macintosh';
Carp::carp(qq{rewriting message in unknown charset "$charset"})
lib/MIME/BodyMunger.pm view on Meta::CPAN
my ($self, $entity, $code) = @_;
Carp::confess "rewrite_lines called on non-text part"
unless $entity->effective_type =~ qr{\Atext/(?:html|plain)(?:$|;)}i;
my $charset = $entity->head->mime_attr('content-type.charset')
|| 'ISO-8859-1';
$charset = 'MacRoman' if lc $charset eq 'macintosh';
Carp::carp(qq{rewriting message in unknown charset "$charset"})
view all matches for this distribution
view release on metacpan or search on metacpan
share/mime-info/freedesktop.org.xml view on Meta::CPAN
<match type="string" value="BSDIFN40" offset="0"/>
</magic>
<glob pattern="*.bsdiff"/>
</mime-type>
<!-- Tree content-types -->
<mime-type type="x-content/image-dcf">
<!-- http://en.wikipedia.org/wiki/Design_rule_for_Camera_File_system -->
<comment>Digital photos</comment>
<treemagic>
<treematch path="dcim" type="directory" non-empty="true"/>
view all matches for this distribution
view release on metacpan or search on metacpan
t/10_expander.t view on Meta::CPAN
is( MIME::Expander->regulate_type('text/plain'), 'text/plain', 'regulate_type normal');
is( MIME::Expander->regulate_type('text/x-me'), 'text/me', 'regulate_type unregistered');
is( MIME::Expander->regulate_type('x-media/x-type'), 'media/type', 'regulate_type unregistered');
is( MIME::Expander->regulate_type(), undef, 'regulate_type undef');
is( MIME::Expander->regulate_type('a'), undef, 'regulate_type invalid');
is( MIME::Expander->regulate_type('text/plain; charset=UTF-8'), 'text/plain', 'regulate_type content-type');
}
# regulate_type (via instance)
{;
t/10_expander.t view on Meta::CPAN
is( $me->regulate_type('text/plain'), 'text/plain', 'regulate_type normal');
is( $me->regulate_type('text/x-me'), 'text/me', 'regulate_type unregistered');
is( $me->regulate_type('x-media/x-type'), 'media/type', 'regulate_type unregistered');
is( $me->regulate_type(), undef, 'regulate_type undef');
is( $me->regulate_type('a'), undef, 'regulate_type invalid');
is( $me->regulate_type('text/plain; charset=UTF-8'), 'text/plain', 'regulate_type content-type');
}
# walk
# => 11_expander_walk.t
view all matches for this distribution