Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for response.history #82

Open
HeartToSunshine opened this issue Jul 14, 2023 · 3 comments
Open

Add support for response.history #82

HeartToSunshine opened this issue Jul 14, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@HeartToSunshine
Copy link

CurlInfo.REDIRECT_COUNT>0时CurlInfo.REDIRECT_URL)=“”是什么原因呢?或者说作者是否能考虑一下实现一下requests下response.history的功能

@yifeikong
Copy link
Owner

如果你用底层的 curl-API 的话,怎么重定向,读取 Location header 返回的 URL 都是可以自己实现的。requests-API 中支持 history 在考虑,有空了会弄下。

@yifeikong yifeikong changed the title 有关重定向过程中的问题 Add support for response.history Nov 24, 2023
@yifeikong yifeikong added the enhancement New feature or request label Jan 1, 2024
@cod888
Copy link

cod888 commented Feb 4, 2024

+1 for this feature

@yifeikong
Copy link
Owner

Sorry, there is no direct way to extract the redirect history of a curl request, if you let curl follow redirects automatically, and that's why this issue has been kept open for so long. You can, however, view the history via debug=True in the debug info.

If you disallow curl to follow redirect automatically, it's possible to extract the next redirect from the Location header, record it, and then follow it manually. However, that might be less performant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants