--- layout: default title: Data URIs redirect_from: - /5.0/uri/schemes/data/ --- # Data URI

Starting with version 1.1.0 all URI objects are defined in the League\Uri namespace. The League\Uri\Schemes namespace is deprecated and will be removed in the next major release.

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 ~~~