Created
February 26, 2018 16:17
-
-
Save zachary-johnson/7606f37ef5d83c028c7f2c8cb55a3cee to your computer and use it in GitHub Desktop.
Authenticating portion of ArchivesSpace Python scripts
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 json | |
import requests | |
import secrets | |
import time | |
startTime = time.time() | |
baseURL = secrets.baseURL | |
user = secrets.user | |
password = secrets.password | |
auth = requests.post(baseURL + '/users/'+user+'/login?password='+password).json() | |
session = auth["session"] | |
headers = {'X-ArchivesSpace-Session':session, 'Content_Type':'application/json'} | |
print 'authenticated' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment