straighten: Processes cURL command-line requests

Description Usage Arguments Value References See Also Examples

Description

Takes in a "Copy as cURL" command line and returns a list of components that can be used to build httr requests or passed to make_req() to automagically make an httr VERB() function.

Usage

1
straighten(curls = read_clip(), quiet = FALSE)

Arguments

curls

a character vector of one or more cURL command lines. It will read from the clipboard (i.e. if you did a "Copy as cURL" from browser developer tools).

quiet

if FALSE, a message with the original cURL command line will be output. (Default: FALSE)

Value

list of length(curls) containing parsed data (i.e. to be used in 'httr' requests)

References

Evaluating Network Performance, Network Monitor

See Also

make_req(), httr VERB()

Examples

1
2
3
4
5
6
7
8
9
library(httr)

my_ip <- straighten("curl 'https://httpbin.org/ip'") %>% make_req()

## Not run: 
# external test which captures live data
content(my_ip[[1]](), as="parsed")

## End(Not run)

curlconverter documentation built on Jan. 15, 2017, 3:04 p.m.