根据我调用的 API,我从 getURIAsynchronous 接收不同的对象类型。当我查询 google api 时,我得到字符串向量,但在Route360的情况下,响应返回二进制原始。我可以以某种方式强制此功能将其作为普通文本接收吗?
这是来自其网站的带有示例 api 密钥的 Route360 示例请求:
> url <- "https://service.route360.net/germany/v1/polygon?cfg=%7B%22sources%22%3A%5B%7B%22lat%22%3A52.51%2C%22lng%22%3A13.37%2C%22id%22%3A%22%22%2C%22tm%22%3A%7B%22bike%22%3A%7B%7D%7D%7D%5D%2C%22polygon%22%3A%7B%22values%22%3A%5B300%2C600%2C900%2C1200%2C1500%2C1800%5D%2C%22serializer%22%3A%22json%22%2C%22pointReduction%22%3Atrue%7D%7D&cb=jQuery21409533774398208668_1482154160827&key=YWtKiQB7MiZETbCoVsG6&_=1482154160828"
> response <- getURIAsynchronous(url)
> typeof(response)
[1] "raw"
> head(response)
[,1]
[1,] 1f
[2,] 8b
[3,] 08
[4,] 00
[5,] 00
[6,] 00