URI: Create URI object

URIR Documentation

Create URI object

Description

This function is responsible for creating a URI object either directly from a string or from its constituent parts. URI allows one to use an existing URI and replace some or all of its components to create a new URI.

Usage

URI(u, path = "/", protocol = "http", port = 80)

Arguments

u

either a template URI or a string giving the URI in typical user-level format, e.g. http://www.omegahat.org/index.html.

path

the specification of the file within the web site. For example, this is the string /a/b/c in http://www.mysite.org/a/b/c.

protocol

a string indicating the protocol to use to access the URI. This is typically "http", https, "ftp", or news. Currently, only http and ftp are supported. Efforts to support https are in progress.

port

the port number given as an integer or a string. Http uses 80 by default and Ftp uses 21. However, this allows us to connect using other ports on which the Web server is listening.

Value

An object of class URI. This has 4 elements.

protocol
host
path
port

The URI object is merely a character vector containing these elements. Some of these elements may be missing if not specified. And in other cases, they will be inserted with missing values (NA) to identify that they are to be overridden.

Note

We have chosed to use S3 classes for simplicity within the project we are working.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

See Also

mergeURI

Examples

## Not run: 
 u = URI("http://www.omegahat.org/index.html")

 URI(u, protocol = "ftp")
 URI(u, path = "/download/R/packages/index.html")

## End(Not run)

omegahat/RHTMLForms documentation built on Nov. 29, 2023, 12:36 a.m.