Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from json import load
- from requests import post
- # GetServerBuildUploadUrl() has been called from Jenkins and its response is stored in a file.
- # Extract upload URL from json file
- UPLOAD_URL_FILE = 'upload_url.json'
- with open(UPLOAD_URL_FILE) as upload_url_file:
- upload_url = load(upload_url_file)['data']['URL']
- print(upload_url)
- # Attempt to upload test zip file to
- files = {'file': ('TestFile.zip', open('TestFile.zip', 'rb'), 'application/x-zip-compressed')}
- r = post(upload_url, files=files)
- print(r.status_code)
- print(r.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement