reprmime(mime, x)

Returns an AbstractString or Vector{UInt8} containing the representation of x in the requested mime type, as written by writemime (throwing a MethodError if no appropriate writemime is available). An AbstractString is returned for MIME types with textual representations (such as "text/html" or "application/postscript"), whereas binary data is returned as Vector{UInt8}. (The function istext(mime) returns whether or not Julia treats a given mime type as text.)

As a special case, if x is an AbstractString (for textual MIME types) or a Vector{UInt8} (for binary MIME types), the reprmime function assumes that x is already in the requested mime format and simply returns x.


See Also

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field

Checking you are not a robot: