|
1 month ago | |
---|---|---|
.github/workflows | 1 month ago | |
R | 1 month ago | |
inst | 1 month ago | |
man | 1 month ago | |
tests | 1 month ago | |
.Rbuildignore | 1 month ago | |
.codecov.yml | 1 month ago | |
.gitignore | 1 month ago | |
.travis.yml | 1 month ago | |
CONDUCT.md | 1 month ago | |
DESCRIPTION | 1 month ago | |
LICENSE | 1 month ago | |
LICENSE.md | 1 month ago | |
NAMESPACE | 1 month ago | |
NEWS.md | 1 month ago | |
README.Rmd | 1 month ago | |
README.md | 1 month ago | |
appveyor.yml | 1 month ago | |
httr2curl.Rproj | 1 month ago |
Turn ‘httr’ Web Requests Into ‘curl’ Command Line Calls
When provided with an ‘httr’ “VERB” call, the request will be made and ‘libcurl’ headers will be captured and post-processed to provide a working ‘curl’ command line call.
The following functions are implemented:
h2c
: Convert an ‘httr’ call to ‘curl’ command lineremotes::install_git("https://git.rud.is/hrbrmstr/httr2curl.git")
NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.
library(httr2curl)
# current version
packageVersion("httr2curl")
## [1] '0.1.0'
h2c(
httr::GET(
url = "https://rud.is/",
httr::user_agent(splashr::ua_apple_tv),
query = list(
a = "b",
c = 1
)
)
)
## [1] "curl --http2 --header \"Accept: application/json, text/xml, application/xml, */*\" --compressed --user-agent \"AppleTV6,2/11.1\" \"https://rud.is/?a=b&c=1\""
h2c(
httr::GET(
url = "https://rud.is/",
httr::user_agent(splashr::ua_apple_tv),
query = list(
a = "b",
c = 1
)
),
use_web_service = TRUE
)
## [1] "curl --header \"Accept: application/json, text/xml, application/xml, */*\" --compressed --user-agent \"AppleTV6,2/11.1\" \"https://rud.is/?a=b&c=1\""
Lang | # Files | (%) | LoC | (%) | Blank lines | (%) | # Lines | (%) |
---|---|---|---|---|---|---|---|---|
R | 5 | 0.36 | 49 | 0.24 | 21 | 0.25 | 40 | 0.26 |
Rmd | 1 | 0.07 | 29 | 0.14 | 19 | 0.23 | 35 | 0.23 |
YAML | 1 | 0.07 | 22 | 0.11 | 2 | 0.02 | 2 | 0.01 |
SUM | 7 | 0.50 | 100 | 0.50 | 42 | 0.50 | 77 | 0.50 |
clock Package Metrics for httr2curl
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.