Skip to content

Instantly share code, notes, and snippets.

@zachary-johnson
Created February 26, 2018 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zachary-johnson/7606f37ef5d83c028c7f2c8cb55a3cee to your computer and use it in GitHub Desktop.
Save zachary-johnson/7606f37ef5d83c028c7f2c8cb55a3cee to your computer and use it in GitHub Desktop.
Authenticating portion of ArchivesSpace Python scripts
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