Skip to content

Instantly share code, notes, and snippets.

@ophentis
Created May 2, 2011 12:25
Show Gist options
  • Save ophentis/951526 to your computer and use it in GitHub Desktop.
Save ophentis/951526 to your computer and use it in GitHub Desktop.
RFC2397: The "data" url scheme
syntax:
dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
mediatype := [ type "/" subtype ] *( ";" parameter )
data := *urlchar
parameter := attribute "=" value
e.g.
data:text/html,<html><body><p><b>Hello, world!</b></p></body></html>
data:text/plain;charset=UTF-8;base64,5L2g5aW977yM5Lit5paH77yB
(url base64 replace (+,=) with (/,.)
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAA..
reference:
http://www.ietf.org/rfc/rfc2397.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment