requests icon indicating copy to clipboard operation
requests copied to clipboard

Doc: missing example

Open nixilb opened this issue 1 year ago • 2 comments

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

nixilb avatar Aug 02 '24 17:08 nixilb

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.

nateprewitt avatar Aug 02 '24 18:08 nateprewitt

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!")

nixilb avatar Aug 02 '24 18:08 nixilb