-
Notifications
You must be signed in to change notification settings - Fork 541
curl issue with native API #4510
Copy link
Copy link
Closed
Labels
Feature: API GuideHackathon: Low Hanging FruitHelp Wanted: DocumentationMentor: pdurbinUser Role: API UserMakes use of APIsMakes use of APIsgood first issueappears at https://github.com/IQSS/dataverse/contributeappears at https://github.com/IQSS/dataverse/contributehacktoberfestIt's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJIt's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJ
Milestone
Metadata
Metadata
Assignees
Labels
Feature: API GuideHackathon: Low Hanging FruitHelp Wanted: DocumentationMentor: pdurbinUser Role: API UserMakes use of APIsMakes use of APIsgood first issueappears at https://github.com/IQSS/dataverse/contributeappears at https://github.com/IQSS/dataverse/contributehacktoberfestIt's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJIt's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJ
Hi Dataverse team,
I wanted to let you know about an issue we ran into using the Native API today. It appears to be an issue with certain versions of curl, in this case curl version 7.56.1. It seems to be related to this issue: curl/curl#2022. The person running the commands was using Windows & Git bash. Our Dataverse instance is version 4.7.1.
Running the data upload command resulted in the following error:
Warning: garbage at end of field specification: ,"categories":["Data"]}We eventually figured out that to get around this, you have to replace the second F flag (before the JSON) with --form-string instead, resulting in a command like this:
curl -H "X-Dataverse-key:$API_TOKEN" -X POST -F 'file=@data.tsv' --from-string 'jsonData={"description":"My description.","categories":["Data"]}' "https://example.dataverse.edu/api/datasets/:persistentId/add?persistentId=$PERSISTENT_ID"I thought you might like to know in case anyone else runs into this. It may be useful to have in the docs somewhere too.