DataUrlFromText(String, MimeType, DataEncoding) Method

Embeds text URL-encoded in a "data" URL (RFC 2397).

Definition

Namespace: FolkerKinzel.DataUrls
Assembly: FolkerKinzel.DataUrls (in FolkerKinzel.DataUrls.dll) Version: 1.0.0+b1c843815044ca6fd87a144c9ff16386002c6473
C#
public static string FromText(
	string? text,
	MimeType mimeType,
	DataEncoding encoding = DataEncoding.Url
)

Parameters

text  String
The text to embed in the "data" URL. text MUST not be passed URL-encoded.
mimeType  MimeType
The MimeType of the text.
encoding  DataEncoding  (Optional)
The encoding to use to embed the text.

Return Value

String
A "data" URL, into which text is embedded.

Exceptions

ArgumentNullExceptionmimeType is null.
FormatExceptiontext could not URL-encoded.

See Also