A web app similar to https://httpbin.org
.
See its specific docs.
You can also see these docs locally, by starting the app:
httpbin <- new_app_process(httpbin_app())
browseURL(httpbin$url())
Usage
httpbin_app(log = interactive())
Examples
app <- httpbin_app()
proc <- new_app_process(app)
url <- proc$url("/get")
resp <- curl::curl_fetch_memory(url)
curl::parse_headers_list(resp$headers)
#> $connection
#> [1] "close"
#>
#> $date
#> [1] "Sat, 09 Nov 2024 14:02:32 GMT"
#>
#> $`content-type`
#> [1] "application/json"
#>
#> $`content-length`
#> [1] "313"
#>
#> $etag
#> [1] "\"ed30074c\""
#>
cat(rawToChar(resp$content))
#> {
#> "args": {},
#> "headers": {
#> "Host": "127.0.0.1:46507",
#> "User-Agent": "R/4.4.2 R (4.4.2 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions",
#> "Accept": "*/*",
#> "Accept-Encoding": "deflate, gzip, br, zstd"
#> },
#> "origin": "127.0.0.1",
#> "path": "/get",
#> "url": "http://127.0.0.1:46507/get"
#> }
proc$stop()