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()
Run the code above in your browser using DataLab