在requests访问之后, 我直接判断resp的值, 如下:

if resp:
do something

发现当Response 为500的时候没有进入if分支, 检查源码,发现Response重写了__bool__方法, 根据resp.raise_for_status来确定是否为True,

当为500时, 为假,

记录一下

最新文章

  1. idapython实现动态函数调用批量注释
  2. Python 小细节备忘
  3. Apache配置多域名 AH00548: NameVirtualHost has no effect and will be removed in the next release
  4. upgrade-php-5-1-to-php-5-3-using-yum-on-centos
  5. Linux System Reinforcement、Intrusion Detection Based On syslog
  6. Android-ImageView.ScaleType
  7. Oracle中NULL值与索引
  8. 数据库系统原理及其应用总结---ShinePans
  9. img标签中的src为php文件
  10. 异步编程和线程的使用(.NET 4.5 )
  11. json的引号之伤
  12. Win10问题汇总
  13. Windows下Oracle 11g安装以及创建数据库
  14. create-react-app入门教程
  15. DRF序列化/反序列化
  16. Link Cut Tree 总结
  17. Android系统自带样式(android:theme)
  18. Python的静态方法和类成员方法
  19. 20155236 2016-2017-2 《Java程序设计》第六周学习总结
  20. 《图解 HTTP 》阅读 —— 第五章

热门文章

  1. centos 6.5安装docker
  2. (在数据库中调用webservices。)SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问
  3. C# 枚举转字符串
  4. ubuntu上使用vim编辑文本内容
  5. 撩课-Web大前端每天5道面试题-Day19
  6. Form表单中Post与Get方法的区别
  7. Algorithm——两个排序数组的中位数
  8. JSP用户登录页面
  9. 破解 jeb 2.3.7 demo
  10. 网络 私有IP和子网掩码设置