我正在尝试使用R中的httr包访问 RapidAPI,如下所示:
library(httr)
url <- "https://extract-news.p.rapidapi.com/v0/article"
queryString <- list(url = "https://www.theverge.com/2020/4/17/21224728/bill-gates-coronavirus-lies-5g-covid-19")
response <- VERB("GET", url, addheaders(x_rapidapi_key ="my-api-key", x_rapidapi_host = "extract-news.p.rapidapi.com"), query = queryString, contenttype("application/octet-stream"))
content(response, "text")
我也尝试访问其他 API。但是,我不断收到此错误消息:
Status: 401
你能帮我解决这个问题吗?提前非常感谢!