有没有人有经验的限制从包?postForm
RCurl
我正在从服务器上提取数据,几乎不知从哪里得到了错误消息* HTTP 1.0, assume close after body
,然后是500 Internal Server Error
. 我测试了配置,一切似乎都很好。我创建了一个干净的数据库并重新上传了我的数据库 20/30 案例,同时使用 API/postForm
调用从R
. 一切正常,直到我达到大约 150 个案例,然后出现错误消息。无论我上传错误中的案例的顺序如何,都会出现大约 150/160 个案例,总文件大小约为 11 到 12 MB。换句话说,错误似乎并不取决于特定情况,因为破坏它的情况不同
任何意见,将不胜感激。
我附上了一个截图来为这个相当无聊的帖子增添一点趣味,并弥补没有一个有效的例子,
更新 2013-08-24 19:33:18Z
这是我的curlVersion()$version
和sessionInfo()
信息,
> curlVersion()$version
[1] "7.22.0"
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: i686-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.1 bitops_1.0-6
更新 2013-08-26 05:39:26Z
正如哈德利的评论中所建议的那样,我添加了RCurl
有效调用和失败调用的详细输出,见下文
适用于数据库中少于 150 个案例的调用
> R.object.API <- postForm(R.object.URL, token=R.object.token, content="record", type="flat", format="csv", rawOrLabel="Label", .opts=curlOptions(ssl.verifypeer=TRUE, cainfo=R.object.crt, verbose=TRUE))
* About to connect() to research.org port 443 (#0)
* Trying xx.xx.xxx.xxx... * connected
* successfully set certificate verify locations:
* CAfile: /home/dir/research.cert
CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=XX; postalCode=XXXXX-XXXX; ST=XX; L=XXXXXX; street=XXX; street=XX XXXXXX XX; O=XXXX, XXX; OU=XXX; CN=research.org
* start date: 2013-02-04 00:00:00 GMT
* expire date: 2016-02-04 23:59:59 GMT
* subjectAltName: research.org matched
* issuer: C=US; O=XXXXXX; OU=XXXXXX; CN=XXXXXX Server XX
* SSL certificate verify ok.
> POST /api/ HTTP/1.1
Host: research.org
Accept: */*
Content-Length: 573
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------XXXXXXXXXXXX
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Date: Mon, 26 Aug 2013 05:16:44 GMT
< Server: Apache/2.2.15 (Red Hat)
< X-Powered-By: PHP/5.3.3
< Expires: 0
< cache-control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=utf-8
<
* Closing connection #0
>
调用失败,数据库中有超过 150 个案例
> R.object.API <- postForm(R.object.URL, token=R.object.token, content="record", type="flat", format="csv", rawOrLabel="Label", .opts=curlOptions(ssl.verifypeer=TRUE, cainfo=R.object.crt, verbose=TRUE))
* About to connect() to research.org port 443 (#0)
* Trying xx.xx.xxx.xxx... * connected
* successfully set certificate verify locations:
* CAfile: /home/dir/research.cert
CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=XX; postalCode=XXXXX-XXXX; ST=XX; L=XXXXXX; street=XXX; street=XX XXXXXX XX; O=XXXX, XXX; OU=XXX; CN=research.org
* start date: 2013-02-04 00:00:00 GMT
* expire date: 2016-02-04 23:59:59 GMT
* subjectAltName: research.org matched
* issuer: C=US; O=XXXXXX; OU=XXXXXX; CN=XXXXXX Server XX
* SSL certificate verify ok.
> POST /api/ HTTP/1.1
Host: research.org
Accept: */*
Content-Length: 573
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------XXXXXXXXXXXX
< HTTP/1.1 100 Continue
* HTTP 1.0, assume close after body
< HTTP/1.0 500 Internal Server Error
< Date: Mon, 26 Aug 2013 05:15:05 GMT
< Server: Apache/2.2.15 (Red Hat)
< X-Powered-By: PHP/5.3.3
< Expires: 0
< cache-control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Content-Length: 276
< Connection: close
< Content-Type: text/html; charset=UTF-8
<
* Closing connection #0
Error: Internal Server Error