Comments (3)
#4 重复
如果您使用 Requests 库,请使用
requests.Session()
维持会话。
每隔一段时间,使用同一 session 向 api 发起请求。
当 cookie 临界过期时,会收到来自 api 的Set-Cookie
头部,包含新的 cookie,原 cookie 作废。
requests 库的 Session 会自动维护更新 cookie 值。
from golibcookie.
#4 重复
如果您使用 Requests 库,请使用
requests.Session()
维持会话。每隔一段时间,使用同一 session 向 api 发起请求。 当 cookie 临界过期时,会收到来自 api 的
Set-Cookie
头部,包含新的 cookie,原 cookie 作废。 requests 库的 Session 会自动维护更新 cookie 值。
也就是说我如果用别的语言和普通的post请求的话,是需要手动将set-cookie头部取出来的吗?
from golibcookie.
也就是说我如果用别的语言和普通的post请求的话,是需要手动将set-cookie头部取出来的吗?
是的。如果使用其他语言自行处理会话,需要严格按照服务器发来header中Set-Cookie的指示,调整下一次请求header中的Cookie值。
from golibcookie.
Related Issues (11)
- 请问可以介绍一下原理吗? HOT 2
- 系统更新 HOT 2
- json转成字符串处理会不会好些? HOT 2
- 没能获取到wechatSESS_ID HOT 2
- 请问能获取到wechatsess_id吗 HOT 1
- 请问大佬这个cookie该如何保活呢 HOT 1
- request session保活id问题 HOT 19
- 获取wechatSESS_ID后使用keep_session.py无法保活,会提示过期 HOT 1
- 无法获取可用cookie HOT 2
- 扫描二维码后不显示error开头的信息 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from golibcookie.