Skip to content

Use a proper way to process request's response. #1

@DmytroHubernatorov

Description

@DmytroHubernatorov

if (str(r) == '<Response [404]>'):

Use a proper way to process request's response according to documentation.
Don't use string representation - it is not reliable.
Use like this:
r.status_code == requests.codes.ok

http://docs.python-requests.org/en/latest/user/quickstart/#response-status-codes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions