Microsoft.Bot.Builder.Dialogs.UrlToken Class Reference

Allow object instances to serialized to URLs. Base64 can not be stored in URLs due to special characters. More...

Static Public Member Functions

static T Decode< T > (string token)
 Decode an item from a url token. More...
 
static string Encode< T > (T item)
 Encode an item to be stored in a url. More...
 

Detailed Description

Allow object instances to serialized to URLs. Base64 can not be stored in URLs due to special characters.

We use Bson and Gzip to make it small enough to fit within the maximum character limit of URLs. http://stackoverflow.com/a/32999062 suggests HttpServerUtility's UrlTokenEncode and UrlTokenDecode is not standards-compliant, but they seem to do the job.

Definition at line 55 of file UrlToken.cs.

Member Function Documentation

static T Microsoft.Bot.Builder.Dialogs.UrlToken.Decode< T > ( string  token)
inlinestatic

Decode an item from a url token.

Template Parameters
TThe item type.
Parameters
tokenThe item token.
Returns
The item instance.

Definition at line 84 of file UrlToken.cs.

static string Microsoft.Bot.Builder.Dialogs.UrlToken.Encode< T > ( item)
inlinestatic

Encode an item to be stored in a url.

Template Parameters
TThe item type.
Parameters
itemThe item instance.
Returns
The encoded token.

Definition at line 63 of file UrlToken.cs.


The documentation for this class was generated from the following file: