| mock_request | R Documentation |
This function creates a new Request for a specific resource defined by a
URL.
mock_request(
url,
method = "get",
content = "",
headers = list(),
app_location = "",
remote_address = "123.123.123.123"
)
url |
A complete url for the resource the request should ask for, including querystring if needed |
method |
The request type (get, post, put, etc). Defaults to |
content |
The content of the request, either a raw vector or a string |
headers |
A list of name-value pairs that defines the request headers |
app_location |
A string giving the first part of the url path that should be stripped from the path |
remote_address |
The IP address of the presumed sender |
A Request object
req <- mock_request(
'http://www.my-fake-website.com/path/to/a/query/?key=value&key2=value2',
content = 'Some important content'
)
# Get the main address of the URL
req$host
# Get the query string
req$query
# ... etc.
# Cleaning up connections
rm(req)
gc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.