我需要为测试启动curl。我需要发送带有“/和其他疯狂的东西的XML。最快的方法是什么?我试过
curl -k -d '<xs:element name="Login"/>' https://thewebsite.com/page.exe
没有运气。
答案 0 :(得分:3)
在Perl中,使用system的列表形式:
system curl
=> qw(-k -d '<xs:element name="Login"/>' https://thewebsite.com/page.exe);
或者,更好的是,使用WWW::Curl(另请参阅libcurl documentation)。
答案 1 :(得分:2)
使用'qw'引用其中一个答案中给出的参数是不正确的,qw将明确地转义并传递xs标签周围的单引号,而在OP的示例中,它们不会
你可以使用......
system('curl', '-k', '-d', '<xs:element name="Login"/>',
'https://thewebsite.com/page.exe');
你应该追求的是什么。我尝试使用该模块。
答案 2 :(得分:1)
反斜杠逃脱它。
\"