R内部保存此字符串。
SOAPAction='"http://www.soaplite.com/Demo#hi"'就像这样:
"\"https://hera.api.madgeniuses.net/pixiSBB/pixiWebLogin\""如何动态地创建这样的字符串?我用过
call = "Demo#hi"
SOAPAction = paste('"','http://www.soaplite.com/',call,'"',sep="")问题有更好的方法吗?例如类似于shQuote的
这有什么好处?在RCurl:http://www.omegahat.org/RCurl/philosophy.html的教程中
curlPerform(url="http://services.soaplite.com/hibye.cgi",
httpheader=c(Accept="text/xml", Accept="multipart/*",
SOAPAction='"http://www.soaplite.com/Demo#hi"',
'Content-Type' = "text/xml; charset=utf-8"),
postfields=body,
verbose = TRUE
)对SOAPAction来说,这样的刺痛是通过的。我想动态地创建这个字符串。
发布于 2014-04-18 23:50:26
我喜欢使用sprintf
SOAPAction <- sprintf('"http://www.soaplite.com/%s"', call)发布于 2014-04-19 11:42:08
可以使用%stri+%运算符从斯蒂连接字符串。
require(stringi)
"a"%stri+%1
## [1] "a1"https://stackoverflow.com/questions/23163955
复制相似问题