Curl command on Rest API giving HTTP 415 Unsupported Media Type
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Curl command on Rest API giving HTTP 415 Unsupported Media Type
I'm trying use curl to send a custom format POST using the Rest API. I'm attempting to follow the documentation but am still getting the 415 response.
curl -H "Content-Type: application/json"
-H "Content-Length: 16"
-H "Authorization: Bearer <access token> https://api.zephyrscale.smartbear.com/v2/automations/executions/custom
-d '{"file": "ll-analytics.csv"}'
I have verified the access token works with a simple GET using curl. I have a feeling my syntax using the file is wrong, or I'm missing something. Any help would be great, thanks!
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
The custom endpoint should be used with Junit 4 file. So your CSV file won't work. If you want to use Junit 5, please use the unit endpoint instead of the custom one.
Please check the doc:
https://support.smartbear.com/zephyr-scale-cloud/docs/test-automation/junit-integration-custom.html
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply. However I am trying to upload results from another CI/CD tool, and it is only presented in CSV. Is the only available format XML for JUnit 5? Or is there another endpoint that supports CSV?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, there is no endpoint supporting CSV.
You can use the API endpoint "POST /testexecutions" to update the status every time.
Otherwise, we support Cucumber JSON result files through an endpoint similar to the Junit endpoint.
If I may, what is your pipeline setup?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, that endpoint is useful to know. I am using GoCD to run tests. However it is a custom python script that generates the CSV file. It won't be too difficult to migrate that script to generate XML instead, which is likely what I will do. Thank you for the help!
