All the methods defined in lua-uri(3) are supported. The "userinfo", "host", and "port" methods will
always return nil, and will throw an exception when passed anything other than nil. The "path" method
will throw an exception if given a new path which is nil or not valid for the "data" scheme.
The following additional methods are supported:
uri:data_bytes(...)
Get or set the data stored in the URI. The existing data is decoded and returned. If a new value is
supplied it must be a string, and will cause the path of the URI to be changed to encode the new
data. The method will choose the encoding which will result in the smallest URI, unless the
datafilter module is not installed, in which case it will always use percent encoding.
An exception is thrown if the datafilter module is not installed and the data in the URI is encoded
as base64, although a data URI using percent encoding will not cause an exception.
The data passed in and returned should not be encoded in any special way, that is taken care of by
the library.
uri:data_media_type(...)
Get or set the media type (MIME type) stored in the URI's path before the comma. This should not
include the ";base64" parameter, which will be included in the path automatically when appropriate.
If there is no media type given in the URI then the default value of "text/plain" will be returned,
and if there is no "charset" parameter given then the default ";charset=US-ASCII" will be included.
The media type is encoded and decoded automatically by this method.