URL v0.2.0 URL.Data View Source

Parses a data URL

Link to this section Summary

Functions

Parse a URI with the :scheme of “data”

Link to this section Types

Link to this type t() View Source
t() :: %URL.Data{data: term(), mediatype: binary(), params: Map.t()}

Link to this section Functions

Link to this function parse(uri) View Source
parse(URI.t()) :: URL.Data.t() | {:error, {module(), binary()}}

Parse a URI with the :scheme of “data”

Example

iex> data = URI.parse "data:text/plain;base64,SGVsbG8gV29ybGQh"
iex> URL.Data.parse(data)
%URL.Data{
  data: "Hello World!",
  mediatype: "text/plain",
  params: %{"encoding" => "base64"}
}