view release on metacpan or search on metacpan
lib/Gantry.pm view on Meta::CPAN
$self->post_max( $self->fish_config( 'post_max' ) || '20000000' );
# set user varible
$self->user( $self->fish_user() );
# set default content-type
$self->content_type( $self->fish_config( 'content_type' ) || 'text/html' );
# set template variables
$self->template( $self->fish_config( 'template' ) );
$self->template_default( $self->fish_config( 'template_default' ) );
lib/Gantry.pm view on Meta::CPAN
=item content_type
$type = $self->content_type;
$self->content_type( 'text/html' );
Set/get for reponse content-type
=item content_length
$type = $self->content_length;
$self->content_length( $length );
view all matches for this distribution
view release on metacpan or search on metacpan
modules/nobinaries.al view on Meta::CPAN
# Check the transfer encoding.
return 'base64 encoded'
if (lc $article->header ('content-transfer-encoding') eq 'base64');
# Check the content type in the main article headers.
my $type = $article->header ('content-type');
return 'Invalid content type'
if ($type =~ /(application|audio|image|video)/i);
# Now, scan the body line by line, counting possibly encoded lines, and
# reject the message if they exceed the above parameters or if we
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Distance/Google.pm view on Meta::CPAN
Carp::croak("Google Maps API returned error: " . $res->status_line);
}
if ( $res->headers->content_type !~ /json/ ) {
my $ct = $res->headers->content_type;
croak "Invalid content-type '$ct' returned from webserver";
}
my $json = JSON->new->utf8;
my $data = $json->decode($res->content);
view all matches for this distribution
view release on metacpan or search on metacpan
t/js_reference/test.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Interactive Polyline Encoder Utility - Google Maps API - Google Code</title>
<link href="http://code.google.com/css/codesite.pack.04102009.css" type="text/css" rel="stylesheet" />
<script src="http://code.google.com/js/codesite_head.pack.04102009.js" type="text/javascript"></script>
<link rel="search" type="application/opensearchdescription+xml" title="Google Code" href="/osd.xml" />
<link href="http://code.google.com/apis/maps/documentation/local_extensions.css" rel="stylesheet" type="text/css" />
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/OGC/Service.pm view on Meta::CPAN
Allow-Origin
Allow-Credentials
Expose-Headers
Max-Age 60*60*24
Allow-Methods GET,POST
Allow-Headers origin,x-requested-with,content-type
=cut
sub CORS {
my $self = shift;
lib/Geo/OGC/Service.pm view on Meta::CPAN
'Allow-Origin' => '',
'Allow-Credentials' => '',
'Expose-Headers' => '',
'Max-Age' => 60*60*24,
'Allow-Methods' => 'GET,POST',
'Allow-Headers' => 'origin,x-requested-with,content-type'
);
# where CORS is in the configuration
my $config = $self->{config}{Common}{CORS} // $self->{config}{CORS};
my @cors;
if (ref $config eq 'HASH') {
view all matches for this distribution
view release on metacpan or search on metacpan
MailBot/UUEncode.pm view on Meta::CPAN
}
defined($nread) or return undef; # check for error
my $string = pack('u',$string);
# jfj note filename and content-type
$string = "\nYour file has been uuencoded:\n\n" .
"begin 644 myfile\n" . $string . " \nend\n";
$out->print($string);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ginger/Reference/Request/IO/Mongrel2.pm view on Meta::CPAN
my $queryhash = 0;
if( $hash && defined $hash->{'QUERY'} ) {
$queryhash = url2hash( $hash->{'QUERY'} );
}
my $content_type = $hash->{'content-type'};
if( $content_type && $content_type =~ m|^multipart/form-data; boundary=(.+)$| ) {
my $bound = "--$1";#\r\n
if( $hash->{'x-mongrel2-upload-start'} ) {
if( ! $hash->{'x-mongrel2-upload-done'} ) {
view all matches for this distribution
view release on metacpan or search on metacpan
example/ls_sha1.pl_output.html view on Meta::CPAN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Source file</title>
</head>
<body>
<pre style="font-family:Courier New;font-size:10pt;"> <span style="color:#00f000;">ebd00</span> tidy<span style="color:#0000ff;"> -> 8158f</span>
<span style="color:#00f000;">8158f</span> Prefix with a * if its a merge<span style="color:#0000ff;"> -> eddef</span>
view all matches for this distribution
view release on metacpan or search on metacpan
deps/libgit2/src/libgit2/transports/http.c view on Meta::CPAN
return -1;
}
/* The response must contain a Content-Type header. */
if (!response->content_type) {
git_error_set(GIT_ERROR_HTTP, "no content-type header in response");
return -1;
}
/* The Content-Type header must match our expectation. */
if (strcmp(response->content_type, stream->service->response_type) != 0) {
git_error_set(GIT_ERROR_HTTP, "invalid content-type: '%s'", response->content_type);
return -1;
}
*complete = true;
stream->state = HTTP_STATE_RECEIVING_RESPONSE;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/GitLab/API/v4/RESTClient.pm view on Meta::CPAN
$content = undef if ! %$content;
}
if (ref $content) {
$content = $self->json->encode( $content );
$headers->{'content-type'} = 'application/json';
$headers->{'content-length'} = length( $content );
}
$options->{content} = $content if defined $content;
view all matches for this distribution
view release on metacpan or search on metacpan
0.003005 2011-07-13
- Provide option to disable gravatars.
- Tweaks to make Gitalist fit for debian (Jonas Genannt).
- Fixes to enable Gitalist to run on Win32 (Christian Walde).
- Fix content-type of core.css handler (Christian Walde).
0.003004 2011-06-07
- Fix dependency typo in Makefile.PL.
0.003003 2011-06-06
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Github/Hooks/Receiver.pm view on Meta::CPAN
return [400, [], ['BAD REQUEST']];
}
# Parse JSON payload
my $payload_json;
if (lc $req->header('content-type') eq 'application/json') {
$payload_json = $req->content;
} elsif (lc $req->header('content-type') eq 'application/x-www-form-urlencoded') {
$payload_json = $req->param('payload');
}
my $payload = eval { decode_json $payload_json }
or return [400, [], ['BAD REQUEST']];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBI/Gofer/Transport/mod_perl.pm view on Meta::CPAN
eval {
$executor = $self->executor_for_apache_request($r);
my $request_content_length = $headers_in->{'Content-Length'};
# XXX get content-type by response_content_type() meth call on serializer?
# (need to think-through content-type, transfer-encoding, disposition etc etc
my $response_content_type = 'application/x-perl-gofer-response-binary';
# XXX should probably contol flow via method: GET vs POST
my $of = "";
if (!$request_content_length) { # assume GET request
my $args = $r->args || '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/API/Method.pm view on Meta::CPAN
$self->_die_with_error($response);
}
if ($response->code == 204) {
return 1;
}
return $response->header('content-type') =~ m!^application/json!
? $self->{json_parser}->decode(decode_utf8($response->content))
: $response->content
;
}
sub _die_with_error {
my ($self, $response) = @_;
my $err_str = $response->status_line;
if ($response->content
&& $response->header('content-type') =~ m!^application/json!) {
my $content = $self->{json_parser}->decode(decode_utf8($response->content));
$err_str = "$err_str: $content->{error}{message}";
}
die $err_str;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/testdata/logger_tests.json view on Meta::CPAN
},
"response": {
"code": 200,
"message": "OK",
"headers": [
"content-type",
"application/json; charset=UTF-8",
"client-date",
"Wed, 29 May 2019 07:08:39 GMT",
"date",
"Wed, 29 May 2019 07:08:39 GMT",
t/testdata/logger_tests.json view on Meta::CPAN
},
"response": {
"code": 400,
"message": "Bad Request",
"headers": [
"content-type",
"application/json; charset=UTF-8",
"client-date",
"Wed, 29 May 2019 07:08:39 GMT",
"date",
"Wed, 29 May 2019 07:08:39 GMT",
t/testdata/logger_tests.json view on Meta::CPAN
},
"response": {
"code": 200,
"message": "OK",
"headers": [
"content-type",
"application/json; charset=UTF-8",
"client-date",
"Mon, 19 Oct 2020 13:26:46 GMT",
"date",
"Mon, 19 Oct 2020 13:26:46 GMT",
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-request.t view on Meta::CPAN
my $chi = CHI->new(driver => 'Memory', global => 0);
$Mock_furl->mock(
request => sub {
return Furl::Response->new(1, 200, 'OK', {'content-type' => 'application/json'}, '{}');
}
);
$Mock_furl_res->mock(
content_type => sub { return 'application/json'; }
view all matches for this distribution
view release on metacpan or search on metacpan
t/Google-OAuth.t view on Meta::CPAN
my $request = $token->request( POST => $tqis, $event ) ;
my @headers = %{ $request->headers } ;
my %headers = map { $_ => 1 } (
'content-type',
'application/x-www-form-urlencoded',
'content-length',
'319',
'authorization',
'Bearer ya29.Et6DoQjLzjpioHPGbMyDeGfUS00SuTlIrIsZE_FIDzXtU0IJ1-AnAg'
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-user-consent.t view on Meta::CPAN
use Google::OAuth2::Client::Simple;
$Mock_furl->mock(
request => sub {
return Furl::Response->new(1, 200, 'OK', {'content-type' => 'text/html'}, 'sign in with your google account');
}
);
$Mock_furl_res->mock(
decoded_content => sub { return 'sign in with your google account'; }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/RestApi/GmailApi1.pm view on Meta::CPAN
To => $p{to},
Subject => $p{subject},
Type => $p{content_type},
Data => encode('UTF-8', $p{body}),
);
$mime->attr('content-type.charset' => 'UTF-8');
$mime->add(Cc => $p{cc}) if $p{cc};
$mime->add(Bcc => $p{bcc}) if $p{bcc};
my $raw = $mime->as_string;
my $encoded = encode_base64($raw, '');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/GraphQL/Client/http.pm view on Meta::CPAN
}
else {
my $encoded_data = $self->json->encode($data);
$options->{content} = $encoded_data;
$options->{headers}{'content-length'} = length $encoded_data;
$options->{headers}{'content-type'} = 'application/json;charset=UTF-8';
}
return $self->_handle_response($self->any_ua->request($method, $url, $options));
}
view all matches for this distribution
view release on metacpan or search on metacpan
ColorPicker.pm view on Meta::CPAN
=cut
#################################################
# send a page to the browser, use mod_perl if available
#
# input: pointer to text, content-type [optional]
# sends: text to server
#
# default content type = text/html
# if not specified
#
view all matches for this distribution
view release on metacpan or search on metacpan
examples/yahoo/YahooApp.pl view on Meta::CPAN
use base qw( Gtk2::GladeXML::Simple );
my $header =<<HEADER;
<html>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<header><title>Yahoo Gtk2 App</title>
<style type="text/css">
.title {font-family: Georgia; color: blue; font-size: 13px}
.description {padding-left: 3px; font-family: Georgia; font-size:10px}
.url {padding-left: 3px; font-family: Georgia; font-size:10px; color: green}
view all matches for this distribution
view release on metacpan or search on metacpan
public/error/maintenance_mode.html view on Meta::CPAN
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta name="description" content="Pittsburgh, PA's finest custom AR-15 and Remington Model 700 builder and customizer."/>
<meta name="keywords" content="pittsburgh, pennsylvania, x86, guns, rifles, pistols, ar15, ar-15, m16, 1911, armalite, yhm, blackout, teppo, jitsu, bryce, porter, arms, suppressor, custom, blackout, 300aac, 6.5grendel 6.5mm, 6.8mm, 6.8 SPC, .300AAC"...
<meta name="author" content="Bryce Porter"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
view all matches for this distribution
view release on metacpan or search on metacpan
lib/GunghoX/FollowLinks.pm view on Meta::CPAN
=head2 setup
=head2 follow_links
Parses the given HTTP::Response/Gungho::Response object and dispatches the
appropriate parser from its content-type.
For each URL found, Automatically dispatches the rules given to the parser,
and if the rules match, the URL is sent to Gungho-E<gt>send_request.
Returns the number of matches found.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HBase/JSONRest.pm view on Meta::CPAN
my $rs = $self->{http_tiny}->request('PUT', $uri, {
content => $JSON_Command,
headers => {
'Accept' => 'application/json',
'content-type' => 'application/json'
},
});
return !$self->_handle_error( $uri, $rs );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HON/Http/UrlChecker/Service.pm view on Meta::CPAN
Readonly::Scalar my $MAXREDIRECT => 10;
Readonly::Array my @HEADERFIELDS => qw(
location
server
content-type
title
date
);
Readonly::Array my @RESPONSEFIELDS => qw(
view all matches for this distribution
view release on metacpan or search on metacpan
examples/meals.pl view on Meta::CPAN
# output the main 'mealPage' chunk. name information
# is supplied with static text. the 'meals' data element
# is handled by the 'outputMeals' routine.
#
# if this were run as a CGI, you'd need to output a
# content-type header as well.
$engine->output('mealPage', {
firstName => 'Homer',
lastName => 'Simpson',
meals => \&outputMeals
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Copy.pm view on Meta::CPAN
my $in = $self->source_handle;
my $data = do {local $/; <$in>;};
my $p = HTML::HeadParser->new;
$p->utf8_mode(1);
$p->parse($data);
my $content_type = $p->header('content-type');
my $encoding = '';
if ($content_type) {
if ($content_type =~ /charset\s*=(.+)/) {
$encoding = $1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Defang.pm view on Meta::CPAN
"integer" => qr/^(-|\+)?\d+$/,
"number" => qr/^(-|\+)?[\d.,]+$/,
# language: Not javascript, vbs or vbscript
"language" => qr/^(XML)$/i,
"media" => qr/^((screen|print|projection|braille|speech|all)[,\s]*)+$/i,
"meta:name" => qr/^(author|progid|originator|generator|keywords|description|content-type|pragma|expires)$/i,
# mime-type: Not javascript
"mime-type" => qr/^(cite|text\/(plain|css|html|xml))$/i,
"list-type" => qr/^(none,a,i,upper-alpha,lower-alpha,upper-roman,lower-roman,decimal,disc,square,circle,round)$/i,
# "rel" => qr/^((copyright|author|stylesheet)\s*)+$/i,
"rel" => qr/^((copyright|author)\s*)+$/i, # XXX external stylesheets can contain scripting, so kill them
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Dojo/editions.pm view on Meta::CPAN
}
}
function setHeaders(http,_2b6){
if(_2b6["headers"]){
for(var _2b7 in _2b6["headers"]){
if(_2b7.toLowerCase()=="content-type"&&!_2b6["contentType"]){
_2b6["contentType"]=_2b6["headers"][_2b7];
}else{
http.setRequestHeader(_2b7,_2b6["headers"][_2b7]);
}
}
lib/HTML/Dojo/editions.pm view on Meta::CPAN
}
}
function setHeaders(http,_7f5){
if(_7f5["headers"]){
for(var _7f6 in _7f5["headers"]){
if(_7f6.toLowerCase()=="content-type"&&!_7f5["contentType"]){
_7f5["contentType"]=_7f5["headers"][_7f6];
}else{
http.setRequestHeader(_7f6,_7f5["headers"][_7f6]);
}
}
lib/HTML/Dojo/editions.pm view on Meta::CPAN
}
}
function setHeaders(http,_2b6){
if(_2b6["headers"]){
for(var _2b7 in _2b6["headers"]){
if(_2b7.toLowerCase()=="content-type"&&!_2b6["contentType"]){
_2b6["contentType"]=_2b6["headers"][_2b7];
}else{
http.setRequestHeader(_2b7,_2b6["headers"][_2b7]);
}
}
lib/HTML/Dojo/editions.pm view on Meta::CPAN
}
}
function setHeaders(http,_662){
if(_662["headers"]){
for(var _663 in _662["headers"]){
if(_663.toLowerCase()=="content-type"&&!_662["contentType"]){
_662["contentType"]=_662["headers"][_663];
}else{
http.setRequestHeader(_663,_662["headers"][_663]);
}
}
lib/HTML/Dojo/editions.pm view on Meta::CPAN
}
}
function setHeaders(http,_7f5){
if(_7f5["headers"]){
for(var _7f6 in _7f5["headers"]){
if(_7f6.toLowerCase()=="content-type"&&!_7f5["contentType"]){
_7f5["contentType"]=_7f5["headers"][_7f6];
}else{
http.setRequestHeader(_7f6,_7f5["headers"][_7f6]);
}
}
lib/HTML/Dojo/editions.pm view on Meta::CPAN
}
}
function setHeaders(http,_311){
if(_311["headers"]){
for(var _312 in _311["headers"]){
if(_312.toLowerCase()=="content-type"&&!_311["contentType"]){
_311["contentType"]=_311["headers"][_312];
}else{
http.setRequestHeader(_312,_311["headers"][_312]);
}
}
view all matches for this distribution