-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
status:incomingNewly created issue to be forwardedNewly created issue to be forwarded
Description
Steps to reproduce:
-
Create an instance of SwordApi and try to get the service document
api = SwordApi("https://demo.dataverse.org/", api_token="give_a_valid_token")
test1 = api.get_service_document()
Additional info:
- get_request method within ../pyDataverse/api.py sets api_token in params["key"] which is the reason for the error, see the snippet below from the code base
params = {}
params["User-Agent"] = "pydataverse"
if self.api_token:
params["key"] = str(self.api_token)
try:
resp = get(url, params=params)
- Instead this should be replaced with basic authentication as given below
params = {}
params["User-Agent"] = "pydataverse"
basic = None
if self.api_token:
basic = HTTPBasicAuth(self.api_token, '')
try:
resp = get(url, params=params, auth=basic)
Metadata
Metadata
Assignees
Labels
status:incomingNewly created issue to be forwardedNewly created issue to be forwarded

