HTTP error 415 for create_collection
Hi,
I'm getting a HTTP error 415 when trying to create a new collection:
from transkribus import TranskribusAPI
from credentials import TRANSKRIBUS_EMAIL, TRANSKRIBUS_PASSWORD
api = TranskribusAPI()
api.login(TRANSKRIBUS_EMAIL, TRANSKRIBUS_PASSWORD)
api.create_collection(name="new_collection")
The exact error message is:
HTTP error 415: <!doctype html><html lang="en"><head><title>HTTP Status 415 – Unsupported Media Type</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 – Unsupported Media Type</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unsupported Media Type</p><p><b>Description</b> The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.</p><hr class="line" /><h3>Apache Tomcat/8.5.65</h3></body></html>
HTTP error 415: <!doctype html><html lang="en"><head><title>HTTP Status 415 – Unsupported Media Type</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 – Unsupported Media Type</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unsupported Media Type</p><p><b>Description</b> The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.</p><hr class="line" /><h3>Apache Tomcat/8.5.65</h3></body></html>
Traceback (most recent call last):
File "myproject\venv\lib\site-packages\transkribus\utils.py", line 13, in try_request
resp.raise_for_status()
File "myproject\venv\lib\site-packages\requests\models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 415 Client Error: 415 for url: https://transkribus.eu/TrpServer/rest/collections/createCollection?collName=new_collection
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "myproject\venv\lib\site-packages\transkribus\utils.py", line 13, in try_request
resp.raise_for_status()
File "myproject\venv\lib\site-packages\requests\models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 415 Client Error: 415 for url: https://transkribus.eu/TrpServer/rest/collections/createCollection?collName=new_collection
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "myproject\venv\lib\site-packages\transkribus\utils.py", line 13, in try_request
resp.raise_for_status()
File "myproject\venv\lib\site-packages\requests\models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 415 Client Error: 415 for url: https://transkribus.eu/TrpServer/rest/collections/createCollection?collName=new_collection
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "myproject\main_TranskribusAPI.py", line 13, in <module>
api.create_collection(name="new_collection")
File "myproject\venv\lib\site-packages\transkribus\api.py", line 94, in create_collection
col_id = self.post(
File "myproject\venv\lib\site-packages\transkribus\api.py", line 82, in post
return self.request(self.session.post, *args, **kwargs)
File "myproject\venv\lib\site-packages\transkribus\api.py", line 70, in request
resp = try_request(method, url, **payload)
File "myproject\venv\lib\site-packages\transkribus\utils.py", line 30, in try_request
return try_request(
File "myproject\venv\lib\site-packages\transkribus\utils.py", line 30, in try_request
return try_request(
File "myproject\venv\lib\site-packages\transkribus\utils.py", line 25, in try_request
raise Exception(msg)
Exception: HTTP error 415: <!doctype html><html lang="en"><head><title>HTTP Status 415 – Unsupported Media Type</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 – Unsupported Media Type</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unsupported Media Type</p><p><b>Description</b> The origin server is refusing to service the request because the payload is in a format not
Any ideas? Thanks in advance.