python requests: how to check for “200 OK”

前端 未结 7 1019
清歌不尽
清歌不尽 2020-12-31 00:57

What is the easiest way to check whether the response received from a requests post was \"200 OK\" or an error has occurred?

I tried doing something like this:

7条回答
提交回复
热议问题