smisk.core.URL — Uniform Resource Locator

Uniform Resource Locator

class smisk.core.URL
scheme

The URL schema, always in lower case.

Type:string
user
Type:string
password
Type:string
host
Type:string
port

Port number. 0 (zero) if unknown or not set.

Type:int
path
Type:string
query
Type:string
fragment
Type:string
to_s(scheme=True, user=True, password=True, host=True, port=True, port80=True, path=True, query=True, fragment=True) → str

String representation.

By passing False (or 0 (zero)) for any of the arguments, you can omit certain parts from being included in the string produced. This can come in handy when for example you want to sanitize away password or maybe not include any path, query or fragment.

In some cases, you will probably not want to include port 80 or 443:

my_url.to_s(port=my_url.port not in (80,443))
Parameters:
  • scheme (bool) –
  • user (bool) –
  • password (bool) –
  • host (bool) –
  • port (bool) –
  • port80 (bool) –
  • path (bool) –
  • query (bool) –
  • fragment (bool) –
Return type:

string

Aliases:

to_str, __str__

static encode(s) → str
static escape(s) → str
static decode(s) → str
static unescape(s) → str
static decompose_query(s) → str