util/create-schema-dspace.py: fix error in POST

The missing "headers=headers" was causing an HTTP 415 that took me
over an hour to fix. Sigh.
This commit is contained in:
Alan Orth 2022-01-11 20:54:19 +02:00
parent 0fca6bbc90
commit b0ef411f62
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -98,7 +98,9 @@ def create_schema(schema):
print(f" Attempting to create schema: {schema['prefix']}") print(f" Attempting to create schema: {schema['prefix']}")
try: try:
request = requests.post(request_url, headers, json=schema, cookies=cookies) request = requests.post(
request_url, headers=headers, json=schema, cookies=cookies
)
except requests.ConnectionError: except requests.ConnectionError:
sys.stderr.write(f" Could not connect to REST API: {args.request_url}\n") sys.stderr.write(f" Could not connect to REST API: {args.request_url}\n")