Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,464,973
Community Members
 
Community Events
176
Community Groups

JUnit Zephyr Scale REST API Import Unsupported Media Type

I am currently trying to upload a JUnit xml document via the

https://api.zephyrscale.smartbear.com/v2/automations/executions/junit

endpoint and get back a 415 for Unsupported Media Type.

I am making the post request with the requests module using Python 3.8. I have tried passing the binary file contents in with the files argument or as part of the body, but both are returning the same error. I have tried both zip and xml files and have the content type set to application/json.

The documentation shows what the response looks like, but an example of the request would be greatly appreciated.

1 answer

I was able to resolve the issue by fixing the header key value from the documentation.

I am currently able to upload the xml file by using the files parameter for the post function and having the body just contain the testCycle value, but the testCycle seems to be ignored.

Was able to resolve the issue by placing the file and testCycle keys in the files parameter and specifying the Content-Type for the testCycle portion.

Neelin,

I am also having this same issue, but I'm not sure that I understand your resolution. 

The json body should be passed on the data= or the json= parm of the request? I've tried both. What did you specify for the body values: (id, utl, key)?

Body = json.dumps ( {
   "testCycle": {
         "id": 1,
         "url": "string",
         "key": "string"
       }
} )

They do not make any sense as this request creates a new execution and test cases 

thanks for posting!

@Neelin Vakil 

Dear Neelin, I searched a lot and couldn't fix this problem, and still receive error 415!!

can you please kindly send me your request script? I would be grateful if you could help me fix this issue.

here is my email: mahshad.dezhsetan@gmail.com.

I was also not able to resolve. I ended up calling curl (from python) to get around the problem.  Please also let me know if you are able to figure it out "the right way".

thanks,  jonathan.silver@terminix.com 

Suggest an answer

Log in or Sign up to answer