Correctly log response.code

Was getting errors `NameError: undefined local variable or method `r'`, this should fix that