# -*- coding: utf-8 -*-
import requests
def get_key_info(response, *args, **kwargs):
"""callback function"""
print response.headers['Content-Type']
def main():
"""
主程序
"""
requests.get('http://www.baidu.com', hooks=dict(response=get_key_info))
main()
python 事件 响应 钩子 event hooks
最新推荐文章于 2024-07-04 16:52:23 发布