POST request with httr2 package
It's related to another post
Rather than rvest, I am trying to use the httr2 package to request the data from this link: https://gnomad.broadinstitute.org/api/. I am not that used to it unfortunately, can someone help?
This is what I have tried so far without luck.
library(tidyverse)
library(httr2)
request("https://gnomad.broadinstitute.org/api/") %>%
req_body_form(
'chrom' = '1',
'datasetId' = 'gnomad_r3',
'referenceGenome' = 'GRCh38',
'start' = 55516868,
'stop' = 55516908
) %>%
req_perform()
Error in `resp_abort()`:
! HTTP 400 Bad Request.
Run `rlang::last_error()` to see where the error occurred.
Comments
Post a Comment