Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: missing example #6782

Open
nixilb opened this issue Aug 2, 2024 · 2 comments
Open

Doc: missing example #6782

nixilb opened this issue Aug 2, 2024 · 2 comments

Comments

@nixilb
Copy link

nixilb commented Aug 2, 2024

Looking at quickstart: a copy paste example that just works with status error magagement, is missing.

@nateprewitt
Copy link
Member

nateprewitt commented Aug 2, 2024

Hi @nixilb, could you be more specific with what you're looking for? We have a section in the Quickstart guide about this topic already.

@nixilb
Copy link
Author

nixilb commented Aug 2, 2024

some COMPLETE code one can copy paste and works

like (found in https://realpython.com/python-requests/)

import requests
from requests.exceptions import HTTPError

try:
    response = requests.get("https://api.github.com")
    response.raise_for_status()
    print(response.text)
except HTTPError as http_err:
    print(f"HTTP error occurred: {http_err}")
except Exception as err:
    print(f"Other error occurred: {err}")
else:
    print("Success!")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants