Last active
December 21, 2023 04:42
-
-
Save pdr-tuche/aa723bafe36e734207283dc0eb9bab3e to your computer and use it in GitHub Desktop.
Request to gitlab API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
user_name = input("digite aqui o seu usuário do gitlab: ") | |
response = requests.get(f"https://gitlab.com/api/v4/users/{user_name}/projects") #type -> <class 'requests.models.Response'> | |
lista_meus_projetos = response.json() #type -> <class 'list'> O metodo json converte o tipo para lista | |
for projeto in lista_meus_projetos: | |
print(f"nome do projeto: {projeto['name']} \nURL do projeto: {projeto['web_url']}\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment