Title: | 'Ping' 'URLs' to Time 'Requests' |
Description: | A suite of functions to ping 'URLs' and to time 'HTTP' 'requests'. Designed to work with 'httr'. |
Version: | 0.2.0 |
License: | MIT + file LICENSE |
URL: | https://github.com/sckott/httping |
BugReports: | https://github.com/sckott/httping/issues |
Depends: | httr (≥ 1.3.1) |
Imports: | methods, stats, jsonlite (≥ 1.5), pryr (≥ 0.1.3), magrittr, httpcode (≥ 0.2.0) |
Suggests: | roxygen2 (≥ 6.0.1), testthat |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2018-01-03 03:19:27 UTC; sckott |
Author: | Scott Chamberlain [aut, cre] |
Maintainer: | Scott Chamberlain <myrmecocystus@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2018-01-03 04:32:52 UTC |
Ping urls to time requests
Description
Ping urls to time requests
Pipes
You can use this function with or without pipes. We export the pipe
%>%
in this package so you don't have to load it separately.
Author(s)
Scott Chamberlain myrmecocystus@gmail.com
Pipe operator
Description
Pipe operator
Usage
lhs %>% rhs
Ping a url, doing a single call, with any http verbs
Description
Ping a url, doing a single call, with any http verbs
Usage
ping(url, verb = GET, ...)
Arguments
url |
A url |
verb |
(character) An http verb, default: |
... |
Any httr verb parameters passed on to those functions |
Examples
## Not run:
"https://mockbin.com/request" %>% ping()
ping("https://mockbin.com/request")
"https://mockbin.com/request" %>% ping(config=verbose())
ping("https://mockbin.com/request", config=verbose())
"https://mockbin.com/request" %>% ping(config=c(verbose(), accept_json()))
"https://mockbin.com/request" %>% ping()
"https://mockbin.com/request" %>% ping(verb=HEAD)
"https://mockbin.com/request" %>% ping(verb=PUT)
"https://google.com" %>% ping()
# pass just a port number, tries to resolve, fails if not found
# "9200" %>% ping()
# 9200 %>% ping()
# 9200 %>% ping(verb=POST)
# 9200 %>% ping(verb=HEAD)
# ping(9200)
# ping("9200")
## End(Not run)
Ping a url to time the request
Description
Ping a url to time the request
Usage
time(.request, count = 10, delay = 0.5, flood = FALSE, verbose = TRUE,
...)
Arguments
.request |
A httr response object |
count |
integer, Number of requests to do. |
delay |
integer, Seconds to delay successive calls by. Default: 0.5 seconds. |
flood |
logical; If |
verbose |
logical; If |
... |
Further args passed on to functions in httr |
Examples
## Not run:
GET("https://mockbin.com/request") %>% time()
GET("https://api.github.com") %>% time()
GET("http://google.com") %>% time()
## End(Not run)