0

I would like to get the query string from the executing URL into my R. I've installed and configured R Apache. Everything works to this extend.

My R code so far is:

query_string <- Sys.getenv("QUERY_STRING")
cat("Content-Type: text/html\r\n\r\n")
cat("Die Anfrage-URL ist:", query_string)

I get no information from QUERY_STRING. Why? Any tipps and tricks?

My executing URL is http://localhost/R/query.R?query=hello

I would like to extract "hello".

1 Answers1

0

It turned out that there is a far more simpler approach.

Just use GET, POST, COOKIES, FILES or SERVER.

When using RApache, you get GET, POST, COOKIES, FILES, SERVER variables which are passed on to the script.

args <- GET
 
print(args[1])
print(args[2])
print(args[3])

http://[ip address]/R/query.R?query=people&word=hello&verb=Simon