0

Consider the following commands (2 examples)

curl -H "Accept:text/plain" http://rxnav.nlm.nih.gov/REST/rxcui/866350/allrelated 

curl -i -L -H "Accept: application/xml"  http://pub.orcid.org/search/orcid-bio?q=digital-object-ids:"10.1088/0031-9155/58/3/535"

The user is able to run those on win7 command line with curl.exe installed. The RCurl package has no vignette and it has a lot of commands to choose from. How do I get the text file and XML file output using RCurl?

juba
  • 47,631
  • 14
  • 113
  • 118
userJT
  • 11,486
  • 20
  • 77
  • 88

1 Answers1

1

I think you can use the following :

mytxt <- getURL("http://rxnav.nlm.nih.gov/REST/rxcui/866350/allrelated", httpheader=c(Accept="text/plain"))

And :

myxml <- getURL('http://pub.orcid.org/search/orcid-bio?q=digital-object-ids:"10.1088/0031-9155/58/3/535"', httpheader=c(Accept="application/xml"))

You will find many examples in the getURL help page.

juba
  • 47,631
  • 14
  • 113
  • 118