File: parseURI.Rd

package info (click to toggle)
r-cran-xml 3.99-0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,688 kB
  • sloc: ansic: 6,659; xml: 2,890; asm: 486; sh: 12; makefile: 2
file content (53 lines) | stat: -rw-r--r-- 1,788 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
\name{parseURI}
\alias{parseURI}
\alias{URI-class}
\alias{coerce,URI,character-method}
\title{Parse a URI string into its elements}
\description{
  This breaks a URI given as a string into its different elements such as
  protocol/scheme, host, port, file name, query.
  This information can be used, for example, when constructing URIs
  relative to a base URI.

  The return value is an S3-style object of class \code{URI}.
  
  This function uses libxml routines to perform the parsing.
}
\usage{
parseURI(uri)
}
\arguments{
  \item{uri}{a single string}
}

\value{
  A list with 8 elements
  \item{scheme}{the name of the protocol being used, http, ftp as a string.}
  \item{authority}{a string represeting a rarely used aspect of URIs}
  \item{server}{a string identifying the host, e.g. www.omegahat.net}
  \item{user}{a string giving the name of the user, e.g. in FTP
  "ftp://duncan@www.omegahat.net", this would yield "duncan"}
  \item{path}{a string identifying the path of the target file}
  \item{query}{the CGI query part of the string, e.g.
         the bit after '?' of the form \code{name=value&name=value}}
  \item{fragment}{a string giving the coo}
  \item{port}{an integer identifying the port number on which the
  connection is to be made}    
}

\seealso{
 \code{\link{getRelativeURL}}
}
\examples{\dontrun{ ## site is flaky
  parseURI("https://www.omegahat.net:8080/RCurl/index.html")
  parseURI("ftp://duncan@www.omegahat.net:8080/RCurl/index.html")

  parseURI("ftp://duncan@www.omegahat.net:8080/RCurl/index.html#my_anchor")

  as(parseURI("http://duncan@www.omegahat.net:8080/RCurl/index.html#my_anchor"), "character")

  as(parseURI("ftp://duncan@www.omegahat.net:8080/RCurl/index.html?foo=1&bar=axd"), "character")
}}
\keyword{IO}
\concept{URI}
\concept{Web}