在curl命令中追加存储在变量中的URL
当我在名为“域”的变量中存储名为“http://juke.com”的字符串时,我遇到了一些问题。其余的是存储在域服务器上的文件名。即 ipurl.php,使其成为“http://juboapp.com/ipurl.php”作为完整的 URL。
当我在下面的代码中调用这个变量时,它会卡在那里并且永远不会继续。基本上,当不处于尝试模式时,它会给出语法错误。有人可以告诉我它的正确语法是什么。
{set ipurl to (do shell script "curl -d \"ipurl=ipurl" & " \" & domain " \" /ipurl.php")}
I am facing some problem when i am storing a string called "http://juke.com" in a variable called domain. and the rest is the filename stored on the domain server. i.e. ipurl.php so that it becomes "http://juboapp.com/ipurl.php" as complete URL.
And when i call this variable in the below code it stucks over there and never proceeds. Basically it gives a syntax error when not in try mode. Can someone tell me what is the proper syntax for it.
{set ipurl to (do shell script "curl -d \"ipurl=ipurl" & " \" & domain " \" /ipurl.php")}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想这就是你所追求的。
在这种情况下,URL 不需要用引号引起来。
I think this is what you're after.
URLs don't require quotes around them in this case.
我已经得到答案了。我使用了 GET 方法而不是 POST 方法,并且它有效。虽然它也适用于 fireshadow52 的上述答案,但我无法让它使用其中的参数。不过还是谢谢。如果有人可以使用 POST 方法中的参数来实现此功能,请发表评论!
这是代码:
谢谢!
I have got the answer. I have used GET method instead of a POST method and it worked. Though it also works with the above answer from fireshadow52, but i wasn't able to get it to work with a parameter in it. thanks though. If anyone could get this working with a parameter in the POST method then please comment!
Here's the code:
Thanks!