--- layout: default title: Data URIs redirect_from: - /5.0/uri/schemes/data/ --- # Data URI
To ease working with Data URIs, the library comes bundle with a URI specific Data class. This class follows [RFC2397](http://tools.ietf.org/html/rfc2397) ## Instantiation In addition to the defined named constructors, because data URI represents files, you can also instantiate a new data URI object from a file path using the `createFromPath` named constructor ~~~php getHost(); //return '' an empty string $uri->withHost('example.com'); // will throw an League\Uri\UriException ~~~