DataUrlFromText(String, String, 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,
	string? mimeType = "text/plain",
	DataEncoding encoding = DataEncoding.Url
)

Parameters

text  String
The text to embed in the "data" URL. text MUST not be passed URL-encoded.
mimeType  String  (Optional)
The Internet Media Type of the text, or null for DefaultMediaType.
encoding  DataEncoding  (Optional)
The encoding to use to embed the text.

Return Value

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

Exceptions

FormatExceptiontext could not URL-encoded.

See Also