来自RCurl的PUT请求

时间:2014-04-01 01:33:55

标签: r rcurl

我正在寻求从R发送一个PUT命令到服务器。以下unix命令行代码段工作正常:

curl -i -k -u "username:pass" -X PUT -d "description=test+test+test" https://somewebsite.com/application

我在httpPUT()上尝试了各种迭代,现在我正在使用内部函数getURLContent:

curl_opts = curlOptions(username = "username", password = "pass", httpauth=AUTH_BASIC,     ssl.verifypeer = FALSE, headerfunction=h$update)

url=paste("https://somewebsite.com/", "application", sep="")

info <- "description=test+test+test"
val <- charToRaw(info)  
getURLContent(url, infilesize = length(val), readfunction = val, upload = TRUE, customrequest = "PUT", .opts=curl_opts)

服务器正在发回类似响应的搜索,就像我实际上没有发布数据一样。有关如何在RCurl中重新创建curl命令行PUT的想法吗?

谢谢!

0 个答案:

没有答案