-
-
Save jimdur8n/6c51d0438899d2a2f397bd09c5651841 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