A request object is created from the appropriate environment variables and is returned as a list. List elements include:
params – list of request parameters
headers – list of HTTP headers
method – "GET"
raw – NULL
content_type – NULL
protocol – "http"
body – NULL
URL request parameters for testing GET requests
Even in the modern era (>= 2017) it is still sometimes useful to build simple web services using CGI scripts. Benefits include: ease of coding; use of standard port 80; service uptime: even if the CGI script dies while handling an earlier request, the script will be restarted for the next request.
Using this function, the body of an R CGI script can begin with:
1 2 3 4
A list containing CGI request elements
The returned object mimics the request object created in the jug package.
1 2 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.