view release on metacpan or search on metacpan
tests/lib/Test/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
tests/lib/Test/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
t/fixtures/jquery.js view on Meta::CPAN
requestHeaders[ name ] = value;
}
return this;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( !state ) {
s.mimeType = type;
}
return this;
t/fixtures/jquery.js view on Meta::CPAN
}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var firstDataType, ct, finalDataType, type,
contents = s.contents,
t/fixtures/jquery.js view on Meta::CPAN
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// Remove auto dataType and get content-type in the process
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
}
}
// Check if we're dealing with a known content-type
if ( ct ) {
for ( type in contents ) {
if ( contents[ type ] && contents[ type ].test( ct ) ) {
dataTypes.unshift( type );
break;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JS/Test/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/JS/jQuery.js view on Meta::CPAN
} catch(e){}
return false;
},
httpData: function( xhr, type, filter ) {
var ct = xhr.getResponseHeader("content-type"),
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.tagName == "parsererror" )
throw "parsererror";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/GRDDL.pm view on Meta::CPAN
my $r = $self->_fetch($s,
Accept => 'application/schema+json, application/x-schema+json, application/json');
if (defined $r
&& $r->code == 200
&& $r->header('content-type') =~ m#^\s*(((application|text)/(x-)?json)|(application/(x-)?schema\+json))\b#)
{
my $schema = from_json($r->decoded_content);
if (defined $schema->{'$schemaTransformation'})
{
$T = $self->_resolve_relative_ref($schema->{'$schemaTransformation'}, $s);
lib/JSON/GRDDL.pm view on Meta::CPAN
my $r = $self->_fetch($transformation_uri,
Accept => 'application/ecmascript, application/javascript, text/ecmascript, text/javascript, application/x-ecmascript');
if (defined $r
&& $r->code == 200
&& $r->header('content-type') =~ m#^\s*((application|text)/(x-)?(java|ecma)script)\b#)
{
return $self->transform_by_jsont($document, $uri, $r->decoded_content, $name, %options);
}
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/RPC/Simple/Dispatcher.pm view on Meta::CPAN
The encoder/decoder object to use. Defaults to L<JSON> with utf8 on.
=item charset
The charset to send in the content-type when creating the response. Defaults
to C<utf-8>.
=item error_handler
A reference to a subroutine which is invoked when an error occurs. May
view all matches for this distribution
view release on metacpan or search on metacpan
t/validate_response.t view on Meta::CPAN
\$ref: '#/components/responses/foo'
default:
\$ref: '#/components/responses/default'
YAML
# response has no content-type, content-length or body.
cmp_deeply(
($result = $openapi->validate_response(response(200), { path_template => '/foo', method => 'post' }))->TO_JSON,
{ valid => true },
'missing Content-Type does not cause an exception',
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/Validator/Schema/OpenAPIv3.pm view on Meta::CPAN
if ($param->{required} and !$val->{exists}) {
$val->{valid} = 0;
return E "/$param->{name}", [qw(object required)];
}
if ($val->{exists}) {
# Ensures we have a valid content-type so we can select a schema
# This can happen if the negotiation fails (e.g. content-type is empty)
$negotiated_content_type //= $param->{accepts}[0];
# Mutate request content-type if one was not set
$val->{content_type} //= $negotiated_content_type;
local $self->{coerce}{arrays} = 1
if $val->{content_type} =~ m!^(application/x-www-form-urlencoded|multipart/form-data)\s*(;|$)!;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSONSchema/Validator/OAS30.pm view on Meta::CPAN
my $method = lc($params{method} or croak 'param "method" is required');
my $openapi_path = $params{openapi_path} or croak 'param "openapi_path" is required';
my $get_user_param = $self->_wrap_params($params{parameters});
my $user_body = $params{parameters}{body} // []; # [exists, content-type, value]
my $base_ptr = $self->json_pointer->xget('paths', $openapi_path);
return 1, [], [] unless $base_ptr;
my $schema_params = {query => {}, header => {}, path => {}, cookie => {}};
lib/JSONSchema/Validator/OAS30.pm view on Meta::CPAN
my $openapi_path = $params{openapi_path} or croak 'param "openapi_path" is required';
my $http_status = $params{status} or croak 'param "status" is required';
my $get_user_param = $self->_wrap_params($params{parameters});
my $user_body = $params{parameters}{body} // []; # [exists, content-type, value]
my $base_ptr = $self->json_pointer->xget('paths', $openapi_path, $method);
return 1, [], [] unless $base_ptr;
my ($result, $context) = (1, {errors => [], warnings => [], direction => 'response'});
lib/JSONSchema/Validator/OAS30.pm view on Meta::CPAN
my $ctype_ptr;
if ($content_type) {
$ctype_ptr = $content_ptr->xget($content_type);
unless ($ctype_ptr) {
return 0, [error(message => qq{content with content-type $content_type is not in schema})], [];
}
} else {
my $mtype_map = $content_ptr->value;
my @keys = $content_ptr->keys(raw => 1);
return 0, [error(message => qq{content type not specified; schema must have exactly one content_type})], [] unless scalar(@keys) == 1;
lib/JSONSchema/Validator/OAS30.pm view on Meta::CPAN
unless (ref $data) {
if (index($content_type, 'application/json') != -1) {
eval { $data = json_decode($data); };
}
# do we need to support other content-type?
}
my $schema_ptr = $ctype_ptr->xget('schema');
my $schema_prop_ptr = $schema_ptr->xget('properties');
lib/JSONSchema/Validator/OAS30.pm view on Meta::CPAN
) {
eval {
$data->{$property_name} = json_decode($data->{$property_name});
};
}
# do we need to support other content-type?
}
}
return $self->validate_schema($data,
schema => $schema_ptr->value,
view all matches for this distribution
view release on metacpan or search on metacpan
example/js/jquery-1.2.6.js view on Meta::CPAN
} catch(e){}
return false;
},
httpData: function( xhr, type, filter ) {
var ct = xhr.getResponseHeader("content-type"),
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.tagName == "parsererror" )
throw "parsererror";
view all matches for this distribution
view release on metacpan or search on metacpan
eg/jslib/jquery-1.3.2.min.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/JaM/GUI/Compose.pm view on Meta::CPAN
wrap_length => $self->config('wrap_line_length_send'),
quote => 1,
);
my $text = $self->gtk_text;
my $charset = $mail->head->mime_attr('content-type.charset');
if ( $charset =~ /^utf-?8$/i ) {
$self->message_window (
message => "Warning:\n\n".
"Reply message was converted from\n".
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Jemplate/Runtime.pm 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/Jifty/I18N.pm view on Meta::CPAN
=head2 promote_encoding STRING [CONTENT-TYPE]
Return STRING promoted to our best-guess of an appropriate
encoding. STRING should B<not> have the UTF-8 flag set when passed in.
Optionally, you can pass a MIME content-type string as a second
argument. If it contains a charset= parameter, we will use that
encoding. Failing that, we use Encode::Guess to guess between UTF-8
and iso-latin-1. If that fails, and the string validates as UTF-8, we
assume that. Finally, we fall back on returning the string as is.
view all matches for this distribution
view release on metacpan or search on metacpan
t/check/http.t view on Meta::CPAN
my $exp_body = $goodbody;
my %results = (
'cache-control' => 'max-age=0',
'connection' => 'Keep-Alive',
'content-type' => 'text/html',
'HTTPVersion' => '1.0',
);
if ( $type eq 'fail' ) {
$exp_body = $badbody;
view all matches for this distribution
view release on metacpan or search on metacpan
eg/us_constitution/amend1.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">
<link rel="stylesheet" type="text/css" href="uscon.css">
<title>Amendment I</title>
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Kelp/Module/YAML/KelpExtensions.pm view on Meta::CPAN
{
my ($self, $expected, $test_name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
$test_name ||= "YAML structure matches";
like $self->res->header('content-type'), qr/yaml/, 'Content-Type is YAML'
or return $self;
my $json = $self->yaml_content;
cmp_deeply($json, $expected, $test_name) or diag explain $json;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Kelp/Request.pm view on Meta::CPAN
attr -charset => sub {
my $self = shift;
return undef unless $self->content_type;
return undef unless $self->content_type =~ m{
^(?: # only on some content-types
text/ | application/
)
.+
;\s*charset=([^;\$]+) # get the charset
}xi;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Keystone/Resolver/Utils.pm view on Meta::CPAN
Because the Apache/Perl project people saw fit to totally change the
API between C<mod_perl> versions 1 and 2, and because the environment
variables that might tell you what version is in use are undocumented
and obscure, it is pretty painful getting hold of the Apache request
object in a portable way -- which you need for things like setting the
content-type. C<apache_request()> does this, returning the Apache 1
or 2 request object if running under Apache, and otherwise returning
the fallback object which is passed in, if any.
=cut
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>
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
t/us_constitution/amend1.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">
<link rel="stylesheet" type="text/css" href="uscon.css">
<title>Amendment I</title>
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
share/js/jquery-1.2.6.js view on Meta::CPAN
} catch(e){}
return false;
},
httpData: function( xhr, type, filter ) {
var ct = xhr.getResponseHeader("content-type"),
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.tagName == "parsererror" )
throw "parsererror";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Klonk/Routes.pm view on Meta::CPAN
? -s $body || undef
: length $body;
return [
$status,
[
'content-type' => $type,
defined $length
? ('content-length' => $length)
: (),
map {
my $k = $_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Koha/Contrib/Tamil/Overdue.pm view on Meta::CPAN
my $content = $self->tx->render($template , $context);
$content =~ s/'/'/g; #FIXME: why?
my $letter = {
title => $cycle->{title},
content => $content,
'content-type' => $has_email ? 'text/plain; charset="UTF-8"' : 'text/html; charset="UTF-8"',
};
if ( $self->verbose ) {
say $letter->{title}, ": borrower #", $borr->{borrowernumber}, " ",
$borr->{surname}, " ", $borr->{firstname};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Konstrukt/Handler/Apache.pm view on Meta::CPAN
if (MODPERL == 1) { #weird...
$request->header_out($field => $headers->{$field});
} else {
$request->headers_out->add($field => $headers->{$field});
}
#special case for content-type and content-encoding, which have to be defined explicitly
if ($field eq 'Content-Type') {
$request->content_type($headers->{$field});
} elsif ($field eq 'Content-Encoding') {
$request->content_encoding($headers->{$field});
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Kossy.pm view on Meta::CPAN
sub {
my $env = shift;
$Kossy::Response::SECURITY_HEADER = $security_header_local;
try {
my $header = bless {
'content-type' => 'text/html; charset=UTF-8',
$security_header_local ? ('x-frame-options' => 'DENY') : (),
}, 'HTTP::Headers::Fast';
my $c = Kossy::Connection->new({
tx => $tx,
req => Kossy::Request->new($env),
view all matches for this distribution
view release on metacpan or search on metacpan
date: 2004/07/17 16:55:24; author: peregrin; state: Exp; lines: +4 -1
turned off warnings of redefined content_type subroutine
date: 2004/07/17 00:02:09; author: peregrin; state: Exp; lines: +35 -20
minor code layout changes, better content-type override, ack ingy
date: 2004/07/15 17:01:59; author: peregrin; state: Exp; lines: +100 -13
required and optional channel elments, with POD
date: 2004/07/15 15:56:40; author: peregrin; state: Exp; lines: +14 -24
view all matches for this distribution
view release on metacpan or search on metacpan
<meta name="OriginalPublicationDate" content="2008/11/14 20:04:00" />
<meta name="UKFS_URL" content="/2/hi/default.stm" />
<meta name="IFS_URL" content="/2/hi/default.stm" />
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
<link href="http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml" rel="alternate" type="application/rss+xml" title="BBC NEWS | News Front Page" />
<link href="/2/low/default.stm" rel="alternate" type="text/html" title="Low Graphics" />
<!-- IFS V4 index_fp -->
view all matches for this distribution