Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一个选项-d可以在 GET 的 URL 处附加数据作为参数,所以我想象还存在一个添加 URL 片段(#“URL 哈希”)的选项。
-d
#
PS:没有任何线索curl --help | grep -i frag。
curl --help | grep -i frag
没有。服务器会忽略片段 - 它们仅适用于浏览器。
当您查找“http://somesite.com/1?myvar=4#myresource”时 - 服务器可以看到 somesite.com、“1”(路径变量)、myvar(查询字符串)、任何发布的数据但遗憾的是不是片段。当客户端(浏览器)取回服务器结果时,它会应用片段然后客户端“轻弹”到书签或让 javascript 发出请求。
从请求 url 获取哈希参数