Skip to content

Instantly share code, notes, and snippets.

@toast38coza
Created October 28, 2014 12:48
Show Gist options
  • Save toast38coza/eb5bd76a0a049e385aab to your computer and use it in GitHub Desktop.
Save toast38coza/eb5bd76a0a049e385aab to your computer and use it in GitHub Desktop.
Calling Jenkins' API with python
import requests
from requests.auth import HTTPBasicAuth
url = 'http://jenkins.mycompany.com/api/json'
username = '..'
token = '..'
response = requests.get(url, auth=HTTPBasicAuth(username, token))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment