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:
Since any 2XX class response is considered successful in HTTP, I would use:
if 200 <= resp.status_code <= 299: print ('OK!') else: print ('Boo!')