Sockets - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Web Features : Network Communication : Sockets Package : Sockets/ParseURL

Sockets

  

ParseURL

  

parse a URL into its components

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

ParseURL(url)

Parameters

url

-

string; URL to be parsed

Description

• 

The procedure ParseURL is used to break a URL into its component parts. The argument url is a Maple string which represents the URL that is to be parsed.

• 

If the URL can be parsed successfully, then a record describing the URL is returned.

  

The record used to describe the URL has the following slots:

scheme

hostname

port

path

user

passwd

• 

Not all components have meaning for all supported URL schema. The meaning of the resource path, in particular, is subject to interpretation according to the URL scheme. Scheme-specific interpretation of resource paths is not currently provided for in this procedure.

• 

When a component is either meaningless, or not present and has no default value, then the corresponding slot has the value NULL. An empty string distinguishes an empty (zero length) slot value from one that is absent entirely in the URL. (For example, telnet://joe:@host.com/path/ versus telnet://joe@host.com/path/)

• 

The URL parser is based on the specification for URLs given in RFC 1738 Uniform Recourse Locators (URL). All the registered URL schema from that specification are supported. URLs whose scheme is unregistered have the following generic syntax:

<scheme>://<username>:<password>@<hostname>:<port>/<resource-path>

Examples

withSockets&colon;

urlParseURLhttp://www.maplesoft.com/applications/

url:=Recordscheme&equals;http&comma;hostname&equals;www.maplesoft.com&comma;port&equals;80&comma;path&equals;applications/&comma;user&equals;&comma;passwd&equals;

(1)

url:-scheme&comma;url:-hostname&comma;url:-port&comma;url:-path

http&comma;www.maplesoft.com&comma;80&comma;applications/

(2)

urlParseURLftp://user:passwd@host.com:2002/path/to/file.txt&colon;

url:-scheme&comma;url:-hostname&comma;url:-port&comma;url:-path&comma;url:-user&comma;url:-passwd

ftp&comma;host.com&comma;2002&comma;path/to/file.txt&comma;user&comma;passwd

(3)

urlParseURLtelnet://www.maplesoft.com:80&colon;

url:-scheme&comma;url:-hostname&comma;url:-port&comma;url:-path

telnet&comma;www.maplesoft.com&comma;80

(4)

urlParseURLunknownScheme://user:passwd@host.com:2002/some/resource?with=search&colon;

url:-scheme&comma;url:-hostname&comma;url:-port&comma;url:-path&comma;url:-user&comma;url:-passwd

unknownscheme&comma;host.com&comma;2002&comma;some/resource?with=search&comma;user&comma;passwd

(5)

References

  

Information Sciences Institute, "RFC 1738 Uniform Resource Locators (URL)," ISI Home Page, http://www.isi.edu/in-notes/rfc1738.txt; accessed 17 November 2005.

See Also

Sockets

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam