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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Is it possible to share the code of how you fixed sollution? I can't seem to get around the 400 error. I used the documentation found here: https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automations/operation/createJUnitExecutions
I've uploaded part of my code on how the request is build, any feedback would be highly appreciated. (It's Google Script)
Thank you,
D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got a working sollution for my Google App Ccript. I needed to:
I used following code and hope it can be of some inspiration.
Regards,
D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.