119 lines
2.9 KiB
HTML
119 lines
2.9 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of URI::data</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>URI::data</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2020-02-08<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
URI::data - URI that contains immediate data
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use URI;
|
|
|
|
$u = URI->new("data:");
|
|
$u->media_type("image/gif");
|
|
$u->data(scalar(`cat camel.gif`));
|
|
print "$u\n";
|
|
open(XV, "|xv -") and print XV $u->data;
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
The <TT>"URI::data"</TT> class supports <TT>"URI"</TT> objects belonging to the <I>data</I>
|
|
<FONT SIZE="-1">URI</FONT> scheme. The <I>data</I> <FONT SIZE="-1">URI</FONT> scheme is specified in <FONT SIZE="-1">RFC 2397.</FONT> It
|
|
allows inclusion of small data items as ``immediate'' data, as if it had
|
|
been included externally. Examples:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
data:,Perl%20is%20good
|
|
|
|
data:image/gif;base64,R0lGODdhIAAgAIAAAAAAAPj8+CwAAAAAI
|
|
AAgAAAClYyPqcu9AJyCjtIKc5w5xP14xgeO2tlY3nWcajmZZdeJcG
|
|
Kxrmimms1KMTa1Wg8UROx4MNUq1HrycMjHT9b6xKxaFLM6VRKzI+p
|
|
KS9XtXpcbdun6uWVxJXA8pNPkdkkxhxc21LZHFOgD2KMoQXa2KMWI
|
|
JtnE2KizVUkYJVZZ1nczBxXlFopZBtoJ2diXGdNUymmJdFMAADs=
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
<TT>"URI"</TT> objects belonging to the data scheme support the common methods
|
|
(described in <FONT SIZE="-1">URI</FONT>) and the following two scheme-specific methods:
|
|
<DL COMPACT>
|
|
<DT id="1">$uri->media_type( [$new_media_type] )<DD>
|
|
|
|
|
|
|
|
|
|
Can be used to get or set the media type specified in the
|
|
<FONT SIZE="-1">URI.</FONT> If no media type is specified, then the default
|
|
<TT>"text/plain;charset=US-ASCII"</TT> is returned.
|
|
<DT id="2">$uri->data( [$new_data] )<DD>
|
|
|
|
|
|
|
|
|
|
Can be used to get or set the data contained in the <FONT SIZE="-1">URI.</FONT>
|
|
The data is passed unescaped (in binary form). The decision about
|
|
whether to base64 encode the data in the <FONT SIZE="-1">URI</FONT> is taken automatically,
|
|
based on the encoding that produces the shorter <FONT SIZE="-1">URI</FONT> string.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">URI</FONT>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 1995-1998 Gisle Aas.
|
|
<P>
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the same terms as Perl itself.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="6"><A HREF="#lbAE">SEE ALSO</A><DD>
|
|
<DT id="7"><A HREF="#lbAF">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:59 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|