ASL
Url Struct Reference

Detailed Description

The components of a URL plus some utility static functions.

#include <Http.h>

Public Member Functions

 Url (const String &u)
 Constructs an object by parsing a URL string.
 
String query () const
 Returns the query string, if any.
 
Dic params () const
 Returns the parameters in the query string as a map of names and values.
 

Static Public Member Functions

static Dic parseQuery (const String &q)
 Parses a query string ("a=2&b=hello") and returns a map if names and values.
 
static String params (const Dic<> &p)
 Builds a query string from a Dic (as key1=value1&key2=value2, with URL encoding of chars)
 
static String encode (const String &s, bool component=false)
 Encodes a string with percent encoding for chars not allowed in URLs, by default more characters are left untouched (including '/', ':', like in JS encodeURI()), if the component flag is set, then more characters are encoded (like JS encodeURIComponent())
 
static String decode (const String &s)
 Decodes a string containing percent-encoded characters.
 

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