【发布时间】:2014-12-30 02:10:56
【问题描述】:
我正在尝试从 url 获取 csv 文件,但它似乎在一分钟后超时。 csv 文件是在请求时创建的,因此需要一分钟多一点。我尝试增加超时,但没有奏效,一分钟后仍然失败。
我使用url和read.csv如下:
# Start the timer
ptm <- proc.time()
urlCSV <- getURL("http://someurl.com/getcsv", timeout = 200)
txtCSV <- textConnection(urlCSV)
csvFile <- read.csv(txtCSV)
close(txtCSV)
# Stop the timer
proc.time() - ptm
结果日志:
Error in open.connection(file, "rt") : cannot open the connection
In addition: Warning message:
In open.connection(file, "rt") :
cannot open: HTTP status was '500 Internal Server Error'
user system elapsed
0.225 0.353 60.445
达到一分钟后一直失败,可能是什么问题?或者如何增加超时时间?
我在浏览器中尝试了 url,它工作正常,但加载 csv 需要一分钟以上
【问题讨论】: