在 IPV6 中如何使用 IPV6 地址和端口号构建 CURL POST http 请求。任何类型的线程都将受到赞赏。
尝试构建如下请求
>curl --interface 'http://[2001:0:db8:1111:0:0:0:11]:8091/?'
但上面给出的错误是“curl:NO URL specified”
>curl -X POST -d curl -X POST `http://[2001:0:db8:1111:0:0:0:11]:8091/?`
然后尝试了上面给出的错误
>bash: http://[2001:0:db8:1111:0:0:0:11]:8091/?: No such file or directory
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
除了使用 URL 之外,还有其他方法吗?
最佳答案
curl -g -d post 'http://[2001:0:db8:1111:0:0:0:11]:8091/'
-g当您使用 IPv6 地址时,选项“回到过去”是必要的。它阻止 curl 将 URL 中的 [] 符号视为通配符指令。 (自 curl 7.37.0(2014 年 5 月)起,curl 不再将数字 IPv6 地址错误地用于 globbing,在这种情况下不再需要使用 -g)
-d 当然是用于发布的。您也可以使用 -v 来查看操作的详细信息。
关于post - IPV6 curl POST 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24302447/