-1

I am trying to get this API (that works in shell) to work within R:

curl -H 'Content-Type: text/json' -d '{"Symbols":["FLDB","APOE"]}' https://toppgene.cchmc.org/API/lookup

I followed this example and wrote this R studio:

library(RCurl)
library(RJSONIO)

postForm("https://toppgene.cchmc.org/API/lookup",
         .opts = list(postfields = toJSON(list(Symbols = "[", "FLDB", "APOE", "]")),
                      httpheader = c('Content-Type' = 'text/json')))

and I get an internal server error. I have all the packages installed and I don't think there is a syntax error.

Any help on this? Thanks.

user2167741
  • 277
  • 1
  • 10

1 Answers1

0

Figured out the answer:

library(RCurl)
library(RJSONIO)

GS <- list("FLDB","APOE")

postForm("https://toppgene.cchmc.org/API/lookup",
                      .opts = list(postfields = toJSON(list(Symbols = GS),
                                   httpheader = c('Content-Type' = 'text/json')))
user2167741
  • 277
  • 1
  • 10