>url ( obj -- url )
Furnace framework ยป URL objects

Prev:<url> ( -- url )
Next:URL"


Vocabulary
urls

Inputs
objan object


Outputs
urlan url


Word description
Converts an object into a URL. If the object is already a URL, does nothing; if it is a string, then it is parsed as a URL.

Errors
Throws an error if the object is of the wrong type, or if it is a string which is not a valid URL.

Examples
If we convert a string to a URL and print it out again, it will print similarly to the input string, except some normalization may have occurred:
USING: accessors prettyprint urls ; "http://www.apple.com" >url .
URL" http://www.apple.com/"

We can examine the URL object:
USING: accessors io urls ; "http://www.apple.com" >url host>> print
www.apple.com

A relative URL does not have a protocol, host or port:
USING: accessors prettyprint urls ; "file.txt" >url protocol>> .
f


Definition

GENERIC: >url ( obj -- url )


Methods