IPV6卷曲POST请求 [英] IPV6 Curl POST request

查看:349
本文介绍了IPV6卷曲POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IPV6中,如何使用IPV6地址和端口号构建CURL POST http请求.任何类型的线程都将受到赞赏.

In IPV6 how to build CURL POST http request with the IPV6 address and port number.Any kind of thread will be appreciated.

试图按如下所示构建请求

Tried to build the request as below

>curl --interface 'http://[2001:0:db8:1111:0:0:0:11]:8091/?'

但是上面的错误为"curl:未指定URL"

But above gave error as "curl: NO URL specified"

>curl -X POST -d  curl -X POST `http://[2001:0:db8:1111:0:0:0:11]:8091/?`

然后尝试上述给出错误的

Then tried the above that gave error as

>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之外,还有其他方法吗?

Is there any alternate method, other than using URL

推荐答案

curl -g -d post 'http://[2001:0:db8:1111:0:0:0:11]:8091/'

-g 选项在过去很早"使用IPv6地址时.它阻止了curl将URL中的[]符号视为globbing指令. (从curl 7.37.0(2014年5月)开始,curl不再将数字IPv6地址误认为是glob,因此在这种情况下不再需要使用-g )

The -g option was necessary "back in the old days" when you used IPv6 addresses. It stops curl from treating the [] symbols in the URL as globbing instructions. (since curl 7.37.0 (May 2014), curl no longer mistakes numerical IPv6 addresses for globbing, making the use of -g in this case no longer necessary)

-d当然是要发布的.您也可以在-v上打一下,以查看该操作的详细信息.

The -d is of course for posting. You can slap on a -v too to get to see details from the operation.

这篇关于IPV6卷曲POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆