Correctly log response.code

Was getting errors `NameError: undefined local variable or method 'r'`, this should fix that since the method is using the `response` variable rather than `r`