view release on metacpan or search on metacpan
t/04-header.t view on Meta::CPAN
'cseq' => '0009 INVITE',
'via' => 'SIP / 2.0 /UDP 192.0.2.2;branch=390skdjuw',
's' => '',
'newfangledheader' => 'newfangled value continued newfangled value',
'unknownheaderwithunusualvalue' => ';;,,;;,;',
'content-type' => 'application/sdp',
'route' => '<sip:services.example.com;lr;unknownwith=value;unknown-no-value>',
'v' => 'SIP / 2.0 / TCP spindle.example.com ; branch = z9hG4bK9ikj8 , SIP / 2.0 / UDP 192.168.255.111 ; branch= z9hG4bK30239',
'm' => '"Quoted string \"\"" <sip:jdrosen@example.com> ; newparam = newvalue ; secondparam ; q = 0.33',
];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Negotiate.pm view on Meta::CPAN
# specific than "text/html", which is more specific than "text/*",
# which in turn is more specific than "*/*"). If not media range
# in the provided Accept field matches the variant's media type,
# then the value assigned is "q=0".
if (exists $accept{'type'} && $ct) {
# First we clean up our content-type
$ct =~ s/\s+//g;
my $params = "";
$params = $1 if $ct =~ s/;(.*)//;
my($type, $subtype) = split("/", $ct, 2);
my %param = ();
lib/HTTP/Negotiate.pm view on Meta::CPAN
next if $at_type ne '*' && $at_type ne $type;
next if $at_subtype ne '*' && $at_subtype ne $subtype;
my $specificness = 0;
$specificness++ if $at_type ne '*';
$specificness++ if $at_subtype ne '*';
# Let's see if content-type parameters also match
while (($pk, $pv) = each %param) {
print "Check if $pk = $pv is true\n" if $DEBUG;
next unless exists $accept{'type'}{$at}{$pk};
next ACCEPT_TYPE
unless $accept{'type'}{$at}{$pk} eq $pv;
lib/HTTP/Negotiate.pm view on Meta::CPAN
- an original piece of ASCII-art may degrade in quality if it is
captured in JPEG form. The qs values should be assigned to each
variant by the content provider; if no qs value has been assigned, the
default is generally "qs=1".
=item content-type
This is the media type of the variant. The media type does not
include a charset attribute, but might contain other parameters.
Examples are:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Parser/XS.pm view on Meta::CPAN
# $ret is the length of the headers, starting the content body
# the other values are the response messages. For example:
# $status = 200
# $message = "OK"
# $headers = [ 'content-type' => 'text/html', ... ]
# and $special_headers{'content-length'} will be filled in
}
view all matches for this distribution
view release on metacpan or search on metacpan
if($result) {
skip "Didn't get response object", 3;
} else {
my $res = $parser->object;
isa_ok($res, 'HTTP::Response');
is($res->header('content-type'), 'text/plain', 'content type is correct');
is($res->content, "Some content!\x0d\x0a", 'content is correct');
}
# <1>
$parser = HTTP::Parser->new(request => 1);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Parser2/XS.pm view on Meta::CPAN
} else {
# $rv contains the length of the response header on success
}
if (exists $r->{'content-type'} &&
$r->{'content-type'}->[0] eq 'text/html')
{
# ...
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Promise/Body/Form/Data.pm view on Meta::CPAN
Each key represents a C<form-data> field and its value can either be a simple string or a C<HTTP::Promise::Body::Form::Field> object.
C<multipart/form-data> is the only valid Content-Type for sending multiple data. L<rfc7578 in section 4.3|https://tools.ietf.org/html/rfc7578#section-4.3> states: "[RFC2388] suggested that multiple files for a single form field be transmitted using a...
See also this L<Stackoverflow discussion|https://stackoverflow.com/questions/36674161/http-multipart-form-data-multiple-files-in-one-input/41204533#41204533> and L<this one too|https://stackoverflow.com/questions/51575746/http-header-content-type-mul...
=head1 CONSTRUCTOR
=head2 new
view all matches for this distribution
view release on metacpan or search on metacpan
Filter: HTTP::Proxy::HeaderFilter::simple
* logger.pl
This filter outputs the important information out of GET and POST
requests: method, URI, cookies, content-type (text/*) and POST
request parameters.
Filter: HTTP::Proxy::HeaderFilter::simple
* adblock.pl
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Request/AsCurl.pm view on Meta::CPAN
my @data = split '&', $content;
my $method = $request->method;
my $uri = $request->uri;
my $headers = $request->headers;
my $user = $headers->authorization_basic;
my @h = grep { $_ !~ /(authorization|content-length|content-type)/i }
$headers->header_field_names;
my @cmd = (["curl"]);
push(@cmd, ["--request", $method, $uri]);
push(@cmd, ["--dump-header", "-"]);
view all matches for this distribution
view release on metacpan or search on metacpan
t/01_basic.t view on Meta::CPAN
hogehoge
----------
{
'_content' => "hogehoge\n",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.0 200 OK
t/01_basic.t view on Meta::CPAN
hogehoge
----------
{
'_content' => "hogehoge\n",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html", "x-test" => [1,2]},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.0 200 OK
t/01_basic.t view on Meta::CPAN
hogehoge
----------
{
'_content' => "hogehoge\n",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html", "x-test" => "1\n X-Test: 2"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.0 200 OK
Content-Type: text/html
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.1 200 OK
Content-Type: text/html
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.1',
'_headers' => { "content-type" => "text/html"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.1 404 Not Found
Content-Type: text/html
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.1',
'_headers' => { "content-type" => "text/html"},
'_rc' => 404,
'_msg' => 'Not Found'
}
----------
HTTP/1.1 200 OK
t/01_basic.t view on Meta::CPAN
FOO_BAR: 42
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.1',
'_headers' => { "content-type" => "text/html", "foo-bar" => 42},
'_rc' => 200,
'_msg' => 'OK'
}
__HEADERS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/SecureHeaders.pm view on Meta::CPAN
# ALLOW-FROM # deprecated
}
# refs https://www.adobe.com/devnet-docs/acrobatetk/tools/AppSec/CrossDomain_PolicyFile_Specification.pdf
sub check_x_permitted_cross_domain_policies {
$_[0] =~ m!\A(?:none|master-only|by-content-type|by-ftp-filename|all)\z!
}
# refs https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
sub check_x_xss_protection {
$_[0] eq '0' or
view all matches for this distribution
view release on metacpan or search on metacpan
- Switched to using IO::File for the file handling, also
turned on binmode to help those on Windows serve images, etc.
0.02 Wed Mar 29 12:00:00 2005
- close fh after reading content. (Max Maischein)
- fixed content-type header (Kang-min Liu & Max)
0.01 Thu Jan 06 21:40:02 2005
- forked from patch to HTTP::Server::Simple
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Session/State/Mixin/ResponseFilter.pm view on Meta::CPAN
}
$res->[1] = \@new_headers;
return $res;
} elsif (my $body = $res->[2]) {
if ( ref $body eq 'ARRAY' ) {
# TODO: look the content-type header.
my $content = '';
for my $line (@$body) {
$content .= $line if length $line;
}
$res->[2] = [$self->html_filter($session_id, $content)];
view all matches for this distribution
view release on metacpan or search on metacpan
- bring in changes from usage at Followerwonk (Chris Prather)
- add on_error handling and structured exceptions (Chris Prather)
- s/decode/decoded_content/ to match HTTP::Message (Chris Prather)
0.003 2013-02-18T23:43:47
- Fix it so that the content-type is set also with add_json (Chris
Prather)
0.002 2013-02-18T23:07:26
- Add a warning about API breakage (Chris Prather)
- split the API out a little (Chris Prather)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Throwable/Role/Status/RequestedRangeNotSatisfiable.pm view on Meta::CPAN
than the current length of the selected resource.)
When this status code is returned for a byte-range request, the
response SHOULD include a Content-Range entity-header field specifying
the current length of the selected resource. This response MUST NOT
use the multipart/byteranges content-type.
=head1 PERL VERSION
This library should run on perls released even a long time ago. It should work
on any version of perl released in the last five years.
lib/HTTP/Throwable/Role/Status/RequestedRangeNotSatisfiable.pm view on Meta::CPAN
#pod than the current length of the selected resource.)
#pod
#pod When this status code is returned for a byte-range request, the
#pod response SHOULD include a Content-Range entity-header field specifying
#pod the current length of the selected resource. This response MUST NOT
#pod use the multipart/byteranges content-type.
#pod
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Tiny/Bandwidth.pm view on Meta::CPAN
binmode $fh;
}
my $upload_limit_bps = $args->{upload_limit_bps};
$args->{content} = $self->_upload_data_callback($fh, $upload_limit_bps);
($args->{headers} ||= +{})->{'content-length'} = -s $fh;
# XXX set content-type via Plack::MIME?
}
my $set_bandwidth_data_callback;
my ($download_content, $download_content_fh);
if (my $download_limit_bps = $args->{download_limit_bps}) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Tiny/FileProtocol.pm view on Meta::CPAN
success => $success,
status => $status,
( !$success ? (reason => $reason) : () ),
content => $content // '',
headers => {
'content-type' => $content_type,
'content-length' => $bytes // 0,
},
};
return $response;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Tiny/Multipart.pm view on Meta::CPAN
}
# Add boundary to Content-Type header
my $before = 'multipart/form-data';
my $after = '';
if( defined $headers->{'content-type'} ) {
if( $headers->{'content-type'} =~ m!^(.*multipart/[^;]+)(.*)$! ) {
$before = $1;
$after = $2;
}
}
$headers->{'content-type'} = "$before; boundary=$boundary$after";
return "--$boundary\x0d\x0a";
}
sub _build_content {
view all matches for this distribution
view release on metacpan or search on metacpan
push @params, join("=", map { uri_escape_utf8($_) } @pair);
}
my $response = HTTP::Tiny->new->request('POST', $url, {
content => join("&", @params),
headers => { 'content-type' => 'application/x-www-form-urlencoded' }
});
print "$response->{status} $response->{reason}\n";
print $response->{content};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Tinyish/Base.pm view on Meta::CPAN
sub internal_error {
my($self, $url, $message) = @_;
return {
content => $message,
headers => { "content-length" => length($message), "content-type" => "text/plain" },
reason => "Internal Exception",
status => 599,
success => "",
url => $url,
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/WebTest/Plugin/SetRequest.pm view on Meta::CPAN
# set request method (with default GET)
if(defined $method) {
if($method =~ /^POST$/i) {
$request->method('POST');
# ensure correct default value for content-type header
$request->header(Content_Type =>
'application/x-www-form-urlencoded');
} else {
$request->method('GET');
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/XSHeaders.pm view on Meta::CPAN
HTTP::Date::str2time($old);
}
sub content_type {
my $self = shift;
my $ct = $self->header('content-type');
$self->header('content-type', shift) if @_;
$ct = $ct->[0] if ref($ct) eq 'ARRAY';
return '' unless defined($ct) && length($ct);
my @ct = split( /;\s*/, $ct, 2 );
for ( $ct[0] ) {
s/\s+//g;
lib/HTTP/XSHeaders.pm view on Meta::CPAN
return @res;
}
sub content_type_charset {
my $self = shift;
my $h = $self->header('content-type');
$h = $h->[0] if ref($h);
$h = "" unless defined $h;
my @v = _split_header_words($h);
if (@v) {
my($ct, undef, %ct_param) = @{$v[0]};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Haineko/SMTPD/Relay/AmazonSES.pm view on Meta::CPAN
'timeout' => $self->{'timeout'},
'ssl_opts' => { 'SSL_verify_mode' => 0 },
'headers' => [
'date' => $datestring,
'host' => SES_ENDPOINT,
'content-type' => 'application/x-www-form-urlencoded',
'if-ssl-cert-subject' => sprintf( "/CN=%s", SES_ENDPOINT ),
'x-amzn-authorization' => sprintf( "AWS3-HTTPS %s", $authheader ),
],
};
my $httpclient = Furl->new( %$methodargv );
view all matches for this distribution
view release on metacpan or search on metacpan
t/jekyll_test_source/_layouts/default.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" xml:lang="en" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{{ page.title }}</title>
<meta name="author" content="<%= @page.author %>" />
<!-- CodeRay syntax highlighting CSS -->
<link rel="stylesheet" href="/css/coderay.css" type="text/css" />
view all matches for this distribution
view release on metacpan or search on metacpan
share/root/wrapper.tt view on Meta::CPAN
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>hopkins HMI[% IF page.title %] - [% page.title %][% END %]</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="description" content="hopkins HMI" />
<meta name="robots" content="index, follow, noarchive" />
<meta name="googlebot" content="noarchive" />
[% IF 0 && page.refresh %]
<meta http-equiv="refresh" content="[% page.refresh %];url=[% c.req.uri %]" />
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Horris/Connection/Plugin/PeekURL.pm view on Meta::CPAN
channel => $msg->channel,
message => "Request failed: $headers->{Reason} ($headers->{Status})",
});
return;
}
@ct = split(/\s*,\s*/, $headers->{'content-type'});
if (grep { /^image\/.+$/i } @ct) {
$ct = 1;
} elsif ( grep { !/^text\/.+$/i } @ct) {
# otherwise it's something we don't know about.
# don't spend the time and memory to load this guy
view all matches for this distribution
view release on metacpan or search on metacpan
0.1.9 Mon Jul 21 13:42:23 2014 KST
- update dzil profile
- added jira web hook event listner
- updated readme
- added <3 script
- using content-type application/json
0.1.8 Fri Feb 14 01:46:35 2014 KST
- [bugzilla] speak quicksearch url
- [githubissue] added
- perltidy all scripts
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Hubot/Scripts/shorten.pm view on Meta::CPAN
)->get(
sub {
my ( $body, $hdr ) = @_;
return if ( !$body || !$hdr->{Status} =~ /^2/ );
## content-type
my @ct = split( /\s*,\s*/, $hdr->{'content-type'} );
if ( grep {/^image\/.+$/i} @ct || grep { !/text/i } @ct ) {
return $msg->send("[$ct[0]] - $bitly");
}
### charset
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Hyper/Developer/Server.pm view on Meta::CPAN
eval {
my $svg = Hyper::Developer::Model::Viewer->new({
for_class => $class,
})->create_graph()->as_svg();
print <<"EOT";
content-type:image/svg+xml
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"
lib/Hyper/Developer/Server.pm view on Meta::CPAN
my $namespace = $config->get_namespace();
my $base_path = $config->get_base_path();
eval {
# Child
print "content-type:text/html; charset=utf-8\n\n";
my @flow_controls;
my @container_controls;
find(
sub {
m{.ini\Z} or return;
view all matches for this distribution
view release on metacpan or search on metacpan
include/hyperman/hm_http2.h view on Meta::CPAN
}
return;
}
if (nl == 14 && hm_strncasecmp(nm, "content-length", 14) == 0) {
hv_stores(env, "CONTENT_LENGTH", newSVpvn(vl, vlen));
} else if (nl == 12 && hm_strncasecmp(nm, "content-type", 12) == 0) {
hv_stores(env, "CONTENT_TYPE", newSVpvn(vl, vlen));
} else if (nl + 5 < 300) {
char keybuf[300];
size_t i;
SV **old;
include/hyperman/hm_http2.h view on Meta::CPAN
}
static void hm_h2_submit_status(pTHX_ hm_h2_sess *s, hm_h2_stream *st,
int status, const char *ctype) {
AV *hav = newAV();
av_push(hav, newSVpvs("content-type"));
av_push(hav, newSVpv(ctype, 0));
hm_h2_submit_response(aTHX_ s, st, status, hav);
SvREFCNT_dec((SV *)hav);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Hypersonic/Protocol/HTTP2.pm view on Meta::CPAN
->line(' snprintf(status_buf, sizeof(status_buf), "%d", status);')
->line(' ')
->line(' /* Submit HTTP/2 response headers */')
->line(' nghttp2_nv hdrs[] = {')
->line(' { (uint8_t*)":status", (uint8_t*)status_buf, 7, strlen(status_buf), NGHTTP2_NV_FLAG_NONE },')
->line(' { (uint8_t*)"content-type", (uint8_t*)ct, 12, strlen(ct), NGHTTP2_NV_FLAG_NONE },')
->line(' { (uint8_t*)"content-length", (uint8_t*)cl_buf, 14, strlen(cl_buf), NGHTTP2_NV_FLAG_NONE },')
->line(' };')
->line(' ')
->line(' /* Create data provider for body */')
->line(' nghttp2_data_provider data_prd;')
lib/Hypersonic/Protocol/HTTP2.pm view on Meta::CPAN
->line('static void h2_send_404(nghttp2_session* session, int32_t stream_id) {')
->line(' static const char* body = "Not Found";')
->line(' ')
->line(' nghttp2_nv hdrs[] = {')
->line(' { (uint8_t*)":status", (uint8_t*)"404", 7, 3, NGHTTP2_NV_FLAG_NONE },')
->line(' { (uint8_t*)"content-type", (uint8_t*)"text/plain", 12, 10, NGHTTP2_NV_FLAG_NONE },')
->line(' { (uint8_t*)"content-length", (uint8_t*)"9", 14, 1, NGHTTP2_NV_FLAG_NONE },')
->line(' };')
->line(' ')
->line(' nghttp2_data_provider data_prd;')
->line(' data_prd.source.ptr = (void*)body;')
lib/Hypersonic/Protocol/HTTP2.pm view on Meta::CPAN
->line(' char status_str[4];')
->line(' snprintf(status_str, sizeof(status_str), "%d", status);')
->line(' ')
->line(' nghttp2_nv hdrs[] = {')
->line(' { (uint8_t*)":status", (uint8_t*)status_str, 7, strlen(status_str), NGHTTP2_NV_FLAG_NONE },')
->line(' { (uint8_t*)"content-type", (uint8_t*)content_type, 12, strlen(content_type), NGHTTP2_NV_FLAG_NONE },')
->line(' };')
->line(' ')
->line(' /* Submit headers WITHOUT END_STREAM - more DATA frames to come */')
->line(' int rv = nghttp2_submit_headers(session, NGHTTP2_FLAG_END_HEADERS,')
->line(' stream_id, NULL, hdrs, 2, NULL);')
view all matches for this distribution