view release on metacpan or search on metacpan
lib/IO/Socket/SSL.pm view on Meta::CPAN
# the info given when the version is zero is not that useful for us
$ssl_ver >>= 8; # check the upper 8 bits only below */
# SSLv2 doesn't seem to have TLS record-type headers, so OpenSSL
# always pass-up content-type as 0. But the interesting message-type
# is at 'buf[0]'.
my $tls_rt_name = ($ssl_ver == $trace_constants{SSL3_VERSION_MAJOR} && $content_type)
? $tc_type2s{$content_type} || "TLS Unknown (type=$content_type)"
: "";
view all matches for this distribution
view release on metacpan or search on metacpan
examples/chart_users_cron.pl view on Meta::CPAN
## You'll get a HTTP::Response object.
if ($response->is_success) {
my $zipped = $response->content;
## Should've gotten gzipped JSON back.
die "Unknown content-type: ".$response->content_type
unless $response->content_type eq 'application/x-gzip';
my $json = memGunzip($zipped);
my $netinfo = decode_json($json);
my $user_count = $netinfo->{GlobalUsers} // 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Image/ExifTool/HTML.pm view on Meta::CPAN
'content-disposition' => { Name => 'ContentDisposition' },
'content-language' => { Name => 'ContentLanguage' },
'content-script-type' => { Name => 'ContentScriptType' },
'content-style-type' => { Name => 'ContentStyleType' },
# note: setting the HTMLCharset like this will miss any tags which come earlier
'content-type' => { Name => 'ContentType', RawConv => \&SetHTMLCharset },
'default-style' => { Name => 'DefaultStyle' },
expires => { },
'ext-cache' => { Name => 'ExtCache' },
imagetoolbar => { Name => 'ImageToolbar' },
lotus => { },
view all matches for this distribution
view release on metacpan or search on metacpan
Tileset.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>Image::Tileset - A tileset loader.</title>
<link rel="stylesheet" href="pod.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
examples/basic_example.pl view on Meta::CPAN
$h->meta({
'http-equiv' => 'expires',
'content' => '-1',
}),
$h->meta({
'http-equiv' => 'content-type',
'content' => 'text/html; charset=UTF-8',
}),
$h->title('Image::VisualConfirmation CAPTCHA integration demo'),
]),
$h->body([
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Imager/Files.pod view on Meta::CPAN
set STDOUT to autoflush
=item 2.
output a content-type header, and optionally a content-length header
=item 3.
put STDOUT into binmode
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Installer/cpanm.pm view on Meta::CPAN
$fatpacked{"File/pushd.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'FILE_PUSHD';
use strict;use warnings;package File::pushd;our$VERSION='1.009';our@EXPORT=qw(pushd tempd);our@ISA=qw(Exporter);use Exporter;use Carp;use Cwd qw(getcwd abs_path);use File::Path qw(rmtree);use File::Temp qw();use File::Spec;use overload q{""}=>sub {...
FILE_PUSHD
$fatpacked{"HTTP/Tiny.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'HTTP_TINY';
package HTTP::Tiny;use strict;use warnings;our$VERSION='0.056';use Carp ();my@attributes;BEGIN {@attributes=qw(cookie_jar default_headers http_proxy https_proxy keep_alive local_address max_redirect max_size proxy no_proxy timeout SSL_options verif...
sub $sub_name {
my (\$self, \$url, \$args) = \@_;
\@_ == 2 || (\@_ == 3 && ref \$args eq 'HASH')
or Carp::croak(q/Usage: \$http->$sub_name(URL, [HASHREF])/ . "\n");
return \$self->request('$req_method', \$url, \$args || {});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Intellexer/API.pm view on Meta::CPAN
);
return $self->_react(
$ua->post(
$uri_obj,
'content-type' => 'application/json',
Content => $json->encode($url_list),
)
);
}
lib/Intellexer/API.pm view on Meta::CPAN
);
return $self->_react(
$ua->post(
$uri_obj,
'content-type' => 'application/json',
Content => $json->encode({'text1' => $text1, 'text2' => $text2}),
)
);
}
lib/Intellexer/API.pm view on Meta::CPAN
);
return $self->_react(
$ua->get(
$uri_obj,
'content-type' => 'application/json',
)
);
}
lib/Intellexer/API.pm view on Meta::CPAN
);
return $self->_react(
$ua->post(
$uri_obj,
'content-type' => 'multipart/form-data',
Content => [path($file)->basename => [$file,] ],
)
);
}
lib/Intellexer/API.pm view on Meta::CPAN
);
return $self->_react(
$ua->post(
$uri_obj,
'content-type' => 'multipart/form-data',
Content => [ path($file1)->basename =>[$file1],
path($file2)->basename =>[$file2] ],
)
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JMAP/Tester.pm view on Meta::CPAN
#pod my $result = $tester->upload(\%arg);
#pod
#pod Required arguments are:
#pod
#pod accountId - the account for which we're uploading (no default)
#pod type - the content-type we want to provide to the server
#pod blob - the data to upload. Must be a reference to a string
#pod
#pod This uploads the given blob.
#pod
#pod The return value will either be a L<failure
lib/JMAP/Tester.pm view on Meta::CPAN
#pod
#pod Valid arguments are:
#pod
#pod blobId - the blob to download (no default)
#pod accountId - the account for which we're downloading (no default)
#pod type - the content-type we want the server to provide back (no default)
#pod name - the name we want the server to provide back (default: "download")
#pod
#pod If the download URI template has a C<blobId>, C<accountId>, or C<type>
#pod placeholder but no argument for that is given to C<download>, an exception
#pod will be thrown.
lib/JMAP/Tester.pm view on Meta::CPAN
my $result = $tester->upload(\%arg);
Required arguments are:
accountId - the account for which we're uploading (no default)
type - the content-type we want to provide to the server
blob - the data to upload. Must be a reference to a string
This uploads the given blob.
The return value will either be a L<failure
lib/JMAP/Tester.pm view on Meta::CPAN
Valid arguments are:
blobId - the blob to download (no default)
accountId - the account for which we're downloading (no default)
type - the content-type we want the server to provide back (no default)
name - the name we want the server to provide back (default: "download")
If the download URI template has a C<blobId>, C<accountId>, or C<type>
placeholder but no argument for that is given to C<download>, an exception
will be thrown.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JQuery/jquery_js/jquery/jquery-latest.js view on Meta::CPAN
} catch(e){}
return false;
},
/* Get the data out of an XMLHttpRequest.
* Return parsed XML if content-type header is "xml" and type is "xml" or omitted,
* otherwise return plain text.
* (String) data - The type of data that you're expecting back,
* (e.g. "xml", "html", "script")
*/
httpData: function( r, type ) {
var ct = r.getResponseHeader("content-type");
var data = !type && ct && ct.indexOf("xml") >= 0;
data = type == "xml" || data ? r.responseXML : r.responseText;
// If the type is "script", eval it in global context
if ( type == "script" )
view all matches for this distribution
view release on metacpan or search on metacpan
JRPC/Client.pm view on Meta::CPAN
Factory method to instantiate and prepare a new JSON-RPC request to a URL. Options in %opts:
=over 4
=item * 'mime' - Mime content-type for request (default: 'application/json')
=item * 'debug' - Dump Request after instantiation (to STDERR).
=back
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
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
- Fix generating correct base_url() object with host and port
4.18 2021-06-17T11:13:58+0900
- Fix content_type validation for OpenAPIv2 and OpenAPIv3
- Fix validating multipart\/form-data with boundary
- Fix validating content-type with charset
- Fix parsing OpenAPIv3 spec with "description", "servers" and "summary" in a
path specifiation.
4.17 2021-04-28T11:30:56+0900
- Add add_default_response() to OpenAPIv2 and OpenAPIv3
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/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