File: getFormParams.Rd

package info (click to toggle)
r-cran-rcurl 1.95-4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,140 kB
  • ctags: 515
  • sloc: ansic: 3,135; xml: 1,734; asm: 993; sh: 12; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 1,297 bytes parent folder | download | duplicates (2)
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
\name{getFormParams}
\alias{getFormParams}
\title{Extract parameters from a form query string}
\description{
  This function facilitates getting the parameter names and values
  from a URL that is an parameterized HTML query.

  This is motivated by a function from Chris Davis and Delft University.
}
\usage{
getFormParams(query, isURL = grepl("^(http|\\\\?)", query))
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{query}{the query string or full URL containing the query}
  \item{isURL}{a logical value. If \code{TRUE}, \code{query} is 
   the full URL and we need to extract the sub-string representing the
   parameters. If \code{isURL} is \code{FALSE}, then \code{query}
   is assumed to be just the string containing the parameters.
  }
}
\value{
  A named character vector
  giving the parameter values  The names are the parameter names.
}
\author{
Duncan Temple Lang
}

\examples{
if(url.exists("http://www.omegahat.net/foo/bob.R")) {

  getFormParams("http://www.omegahat.net/foo/bob.R?xyz=1&abc=verylong")

  getFormParams("xyz=1&abc=verylong")
  getFormParams("xyz=1&abc=&on=true")
  getFormParams("xyz=1&abc=")
}
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{programming}
\keyword{interface}