gpt4 book ai didi

curl - cURL 302 发现了什么?

转载 作者:行者123 更新时间:2023-12-03 21:40:21 26 4
gpt4 key购买 nike

cURL 给我这个页面:

302 Found

The document has been temporarily moved to here.


对于某些网站,但在浏览器中该网站加载完美。
我该如何解决?

最佳答案

您需要添加 -L 选项,请参阅手册页引用:

-L, --location

(HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I, --head, headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial host. If a redirect takes curl to a different host, it won't be able to intercept the user+password. See also --location-trusted on how to change this. You can limit the amount of redirects to follow by using the --max-redirs option.

When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request with a GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following request using the same unmodified method.



引用: http://curl.haxx.se/docs/manpage.html

关于curl - cURL 302 发现了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8788159/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com