post - IPV6 curl POST 请求

标签 post curl ipv6

在 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/

相关文章:

iOS 通过 POST 到 Web 服务器 - 字符串被切断?

javascript - 语法错误: Unexpected token s in JSON at position 1

web-services - Asmx 从 Extjs 接收 POST 值(参数)?

php - 使 CER 证书只能通过 Apache2 Web 服务器上的 CURL 访问

c++ - 数据被添加到 curl 的检索内容中

c - libcurl (7.19,7) 在 OSX (10.6.8) 上因 _mdns_query_callback 而崩溃

jQuery .ajax post 因大型 JSON 对象而失败

sockets - 如何处理getaddrinfo和线程安全?

python - 在 Mac OS 下查找事件的 IPv6 接口(interface)(使用 Python)

debugging - JVM 是否监听 IPv6 调试端口?