Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on valid command #23

Open
eliocamp opened this issue Aug 30, 2019 · 0 comments
Open

Error on valid command #23

eliocamp opened this issue Aug 30, 2019 · 0 comments

Comments

@eliocamp
Copy link

I was trying to figure out how to use curl's --head flag in R and found your package. However, it threw an error, even though the command is valid.

library(curlconverter)
#> Loading required package: httr

cur <- "curl -s --head -X GET www.google.com"

head(system(cur, intern = TRUE))
#> [1] "HTTP/1.1 200 OK\r"                                                      
#> [2] "Date: Fri, 30 Aug 2019 23:37:50 GMT\r"                                  
#> [3] "Expires: -1\r"                                                          
#> [4] "Cache-Control: private, max-age=0\r"                                    
#> [5] "Content-Type: text/html; charset=ISO-8859-1\r"                          
#> [6] "P3P: CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"\r"

straighten(cur)
#> curl -s --head -X GET www.google.com
#> Error: 
#>  usage: curl [<url>] [-H LINE ...] [-X COMMAND <url>] [-X COMMAND] [--request COMMAND] [--request COMMAND <url>] [options] [<url>]

Maybe is it that neither httr or curl implement the --head flag? I'm looking all over the documentation and not finding it 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant