view release on metacpan or search on metacpan
lib/Hypothesis/API.pm view on Meta::CPAN
}
my $data = $json->encode($payload_out);
my $h = HTTP::Headers->new;
$h->header(
'content-type' => 'application/json;charset=UTF-8',
'x-csrf-token' => $self->csrf_token,
'X-Annotator-Auth-Token' => $self->token,
);
$self->ua->default_headers( $h );
my $url = URI->new( "${\$self->api_url}/annotations" );
lib/Hypothesis/API.pm view on Meta::CPAN
warn "No id given to delete.\n";
return 0;
}
my $h = HTTP::Headers->new;
$h->header(
'content-type' => 'application/json;charset=UTF-8',
'x-csrf-token' => $self->csrf_token,
'X-Annotator-Auth-Token' => $self->token,
);
$self->ua->default_headers( $h );
my $url = URI->new( "${\$self->api_url}/annotations/$id" );
lib/Hypothesis/API.pm view on Meta::CPAN
return -1;
}
my $h = HTTP::Headers->new;
$h->header(
'content-type' => 'application/json;charset=UTF-8',
'x-csrf-token' => $self->csrf_token,
);
$self->ua->default_headers( $h );
my $payload = {
username => $self->username,
lib/Hypothesis/API.pm view on Meta::CPAN
sub search {
my ($self, $query, $page_size) = @_;
my $h = HTTP::Headers->new;
$h->header(
'content-type' => 'application/json;charset=UTF-8',
'x-csrf-token' => $self->csrf_token,
);
if (not defined $query) {
$query = {};
}
lib/Hypothesis/API.pm view on Meta::CPAN
#
my ($self, $query, $page_size) = @_;
my $h = HTTP::Headers->new;
$h->header(
'content-type' => 'application/json;charset=UTF-8',
'x-csrf-token' => $self->csrf_token,
);
if (not defined $query) {
$query = {};
}
lib/Hypothesis/API.pm view on Meta::CPAN
die "Can only call update if given an id.";
}
my $data = $json->encode($payload);
my $h = HTTP::Headers->new;
$h->header(
'content-type' => 'application/json;charset=UTF-8',
'x-csrf-token' => $self->csrf_token,
'X-Annotator-Auth-Token' => $self->token,
);
$self->ua->default_headers( $h );
my $url = URI->new( "${\$self->api_url}/annotations/$id" );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IDS/DataSource/HTTP.pm view on Meta::CPAN
# 14.12 Content-Language; simple and already handled by key+value
'content-length' => 'IDS::DataSource::HTTP::Int', # 14.13
# 14.14 Content-Location likely to be server->client
'content-md5' => 'IDS::DataSource::HTTP::MD5', # 14.15
# 14.16 Content-Range is server->client
'content-type' => 'IDS::DataSource::HTTP::Accept', # 14.17
'date' => 'IDS::DataSource::HTTP::Date', # 14.18
'etag' => 'IDS::DataSource::HTTP::ETag', # 14.19
'expect' => 'IDS::DataSource::HTTP::Expectation', # 14.20
'expires' => 'IDS::DataSource::HTTP::Date', # 14.21
'from' => 'IDS::DataSource::HTTP::EmailAddr', # 14.22
view all matches for this distribution
view release on metacpan or search on metacpan
t/09annotations.t view on Meta::CPAN
use IMAP::Client;
my $client = IMAP::Client->new;
my @getannotation_response = ('* ANNOTATION "user.emailj" "/vendor/cmu/cyrus-imapd/lastupdate" ("value.shared" "19-Sep-2006 12:51:07 -0400" "content-type.shared" "text/plain" "size.shared" "26")'."\r\n",
'* ANNOTATION "user.emailj" "/vendor/cmu/cyrus-imapd/size" ("value.shared" "4424" "content-type.shared" "text/plain" "size.shared" "4")'."\r\n",
'* ANNOTATION "user.emailj" "/vendor/cmu/cyrus-imapd/partition" ("value.shared" "default" "content-type.shared" "text/plain" "size.shared" "7")'."\r\n",
'* ANNOTATION "user.emailj" "/vendor/cmu/cyrus-imapd/server" ("value.shared" "imapbackend.server1.com" "content-type.shared" "text/plain" "size.shared" "23")'."\r\n",
'. OK Completed'."\r\n",);
my %resp = IMAP::Client::parse_annotation(\@getannotation_response ,'user.emailj',$client);
is (scalar (keys %resp), 1);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/HTML.pm view on Meta::CPAN
} # Skip comment
elsif (m!\G<meta(?=[\x09\x0A\x0C\x0D /])!gic) {
my ($got_pragma, $need_pragma, $charset);
while (my ($name, $value) = &_get_attribute) {
if ($name eq 'http-equiv' and $value eq 'content-type') {
$got_pragma = 1;
} elsif ($name eq 'content' and not defined $charset) {
$need_pragma = $expect_pragma
if defined($charset = _get_charset_from_meta($value));
} elsif ($name eq 'charset') {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/HyCon.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></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:support@citrusperl.org" />
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
html/lib/IO/Moose.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>IO::Moose - Reimplementation of IO::* with improvements</title>
<link rel="stylesheet" href="../../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:support@ActiveState.com" />
</head>
<body>
<table border="0" width="100%" cellspacing="0" cellpadding="3">
view all matches for this distribution
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 The first hashref provides values that go into the download URI:
#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
The first hashref provides values that go into the download URI:
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
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