Package 'httping'

Title: 'Ping' 'URLs' to Time 'Requests'
Description: A suite of functions to ping 'URLs' and to time 'HTTP' 'requests'. Designed to work with 'httr'.
Authors: Scott Chamberlain [aut, cre]
Maintainer: Scott Chamberlain <[email protected]>
License: MIT + file LICENSE
Version: 0.2.9.91
Built: 2024-10-29 03:30:27 UTC
Source: https://github.com/sckott/httping

Help Index


httping

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


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: httr::GET()

...

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 TRUE, no delay between requests. If FALSE, delay by 0.5 second.

verbose

logical; If TRUE, print progress.

...

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)