Aloe Express Methods

This page provides information on the helper methods that are provided by Aloe Express.

ArgsToDictionary

Converts an array of command line arguments (strings) to a Xojo.Core.Dictionary. This method is used by the Server.Constructor method to set server properties based on command line arguments.

Example:

Dim Arguments As Xojo.Core.Dictionary = ArgsToDictionary(Args)

DateToRFC1123

Converts a Xojo.Core.Date to a RFC 822 / 1123 formatted text value. For example: Mon, 27 Nov 2017 13:27:26 GMT Special thanks to Xojo's Norman Palardy for providing this method.

Example:

// Get the current time in RFC1123 format.
Dim Now As String = AloeExpress.DateToRFC1123(Xojo.Core.Date.Now)

FileRead

Given a FolderItem, this method will attempt to read the file, and if successful, returns its contents.

Example:

// Create a folderitem that points to the template file.
Dim FI as FolderItem = Request.StaticPath.Child("index.html")

// Use Aloe's FileRead method to load the file.
HTML = AloeExpress.FileRead(FI)

Gunzip

Decompresses content that has been compressed (gzipped).

Gzip

Compresses (gzips) content. Special thanks to John Hansen for sharing this technique.

Example:

Content = GZip(Content)

MIMETypeGet

Maps a file extension to its MIME type. If no matching MIM type is found, "binary/octet-stream" is returned. Based in large part on Samuel Neff's MimeTypeMap.

Example:

Request.Response.Headers.Value("Content-Type") = AloeExpress.MIMETypeGet("pdf")

URLDecode

Decodes a URL-encoded value.

URLEncode

URL-encodes a value. This method is a wrapper for Xojo's EncodeURLComponent, and is provided for consistency and convenience.

UUIDGenerate

Generates a UUID. Special thanks to Roberto Calvi for providing this code.