{
    "mode": "perldoc",
    "parameter": "URI::data",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/URI%3A%3Adata/json",
    "generated": "2026-07-05T13:34:14Z",
    "synopsis": "use URI;\n$u = URI->new(\"data:\");\n$u->mediatype(\"image/gif\");\n$u->data(scalar(`cat camel.gif`));\nprint \"$u\\n\";\nopen(XV, \"|xv -\") and print XV $u->data;",
    "sections": {
        "NAME": {
            "content": "URI::data - URI that contains immediate data\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use URI;\n\n$u = URI->new(\"data:\");\n$u->mediatype(\"image/gif\");\n$u->data(scalar(`cat camel.gif`));\nprint \"$u\\n\";\nopen(XV, \"|xv -\") and print XV $u->data;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The \"URI::data\" class supports \"URI\" objects belonging to the *data* URI scheme. The *data* URI\nscheme is specified in RFC 2397. It allows inclusion of small data items as \"immediate\" data, as\nif it had been included externally. Examples:\n\ndata:,Perl%20is%20good\n\ndata:image/gif;base64,R0lGODdhIAAgAIAAAAAAAPj8+CwAAAAAI\nAAgAAAClYyPqcu9AJyCjtIKc5w5xP14xgeO2tlY3nWcajmZZdeJcG\nKxrmimms1KMTa1Wg8UROx4MNUq1HrycMjHT9b6xKxaFLM6VRKzI+p\nKS9XtXpcbdun6uWVxJXA8pNPkdkkxhxc21LZHFOgD2KMoQXa2KMWI\nJtnE2KizVUkYJVZZ1nczBxXlFopZBtoJ2diXGdNUymmJdFMAADs=\n\n\"URI\" objects belonging to the data scheme support the common methods (described in URI) and the\nfollowing two scheme-specific methods:\n\n$uri->mediatype( [$newmediatype] )\nCan be used to get or set the media type specified in the URI. If no media type is\nspecified, then the default \"text/plain;charset=US-ASCII\" is returned.\n\n$uri->data( [$newdata] )\nCan be used to get or set the data contained in the URI. The data is passed unescaped (in\nbinary form). The decision about whether to base64 encode the data in the URI is taken\nautomatically, based on the encoding that produces the shorter URI string.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "URI\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 1995-1998 Gisle Aas.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "URI::data - URI that contains immediate data",
    "flags": [],
    "examples": [],
    "see_also": []
}