在 R 中使用 httr 包时出现访问问题

Access issue while using httr package in R

我有一个应用程序的以下详细信息:

http://45.56.112.95/location/
Device-Id: fd2364ca08f871
client-info: XXXXX
client-version: 13605
Client-Key: XYZ
Device-Info: 5.0 (asus ASUS_Z00AD)
client: mobile_android
X-Api-Version: 2.0
Latitude: 28.6254984
Longitude: 77.3783081

我尝试了两种使用 R 中的 httr 包访问应用程序的方法,但均未成功。以下是查询和收到的错误:

**First Try**
a <- GET("http://45.56.112.95/location/", add_headers(.headers = c(Client-Key="XYZ", Latitude = "28.6254984", Longitude = "77.3783081" )))

Error: unexpected '=' in "a <- GET("http://45.56.112.95/location/", add_headers(.headers = c(Client-Key="

**Second Try**
a = GET("http://45.56.112.95/location/", authenticate("Client-Key", "XYZ"), add_headers(.headers = c(Latitude = "28.6254984", Longitude = "77.3783081")))

Client error: (403) Forbidden

我不确定我的查询是否正确,这实际上是一个授权问题。或者如果我的查询是错误的。提前致谢。

尝试在 Client-Key 周围加上引号?

a <- GET("http://45.56.112.95/location/", add_headers(.headers = c("Client-Key"="XYZ", Latitude = "28.6254984", Longitude = "77.3783081" )))