Unirest.post return status 500 when import feature via zip file

lekean
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 4, 2019

I am trying to update feature file via zip with java unirest. But i got response status 500. The same zip file post via Postman is working fine.

HttpResponse<String> response = Unirest.post("https://xray.cloud.xpand-it.com/api/v1/import/feature?projectKey=OBH")
.header("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
.header("Content-Type", "application/x-www-form-urlencoded")
.header("Authorization", "Bearer "+accessToken)
.header("Connection", "keep-alive")
.header("cache-control", "no-cache")
.body("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"file\"; filename=\"D:\\fo.zip\"\r\nContent-Type: application/zip\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--")
.asString();

Is it something wrong on the Unirest post body?

1 answer

0 votes
Inês Silva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2019

Hi lekean,

Here you can find all information about our REST API, specially all the endpoints that can be used and the how-to to do these endpoints. And here you can find information about import multiple executions results by using a ZIP file. 


The 500 error means that an internal error occurred when importing execution results. 
I suggest you to take a look into our documentation and if the problem persists, please use the support channel to share all of your questions with us.

Best regards, 

Xray Team

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events