IPV6卷曲POST请求

use*_*809 2 post curl ipv6

在IPV6中如何使用IPV6地址和端口号构建CURL POST http请求.任何类型的线程将不胜感激.

试图建立如下的请求

>curl --interface 'http://[2001:0:db8:1111:0:0:0:11]:8091/?'
Run Code Online (Sandbox Code Playgroud)

但上面给出了错误,因为"卷曲:没有指定URL"

>curl -X POST -d  curl -X POST `http://[2001:0:db8:1111:0:0:0:11]:8091/?`
Run Code Online (Sandbox Code Playgroud)

然后尝试了以上给出错误的

>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
Run Code Online (Sandbox Code Playgroud)

除了使用URL之外,还有其他方法吗?

Dan*_*erg 6

curl -g -d post 'http://[2001:0:db8:1111:0:0:0:11]:8091/'
Run Code Online (Sandbox Code Playgroud)

当您使用IPv6地址时,-g选项对于"旧时代"是必要的.它会阻止curl将URL中的[]符号视为通配指令.(自curl 7.7.0.05(2014年5月)以来,curl不再为globbing错误数字IPv6地址,因此在这种情况下不再需要使用-g)

-d当然是发布的.您也可以使用-v来查看操作中的详细信息.

  • 不,您的意思是您需要在[2013](https://curl.haxx.se/changes.html#7_29_0)中进行操作。我认为这符合“过去”的条件。 (2认同)