我正在尝试创建一个"周期"在使用zephyr java rest API的zephyr中。我编写了以下客户端代码来创建循环。
String auth = new String(Base64.encode("test.manager:test.manager"));
Client client1 = Client.create();
String cycle ="{'name': 'Cycle with TCR phase', 'build': '7993', 'environment': 'MyOwnEnv', 'startDate': 1447957800000, 'endDate': 1448389800000, 'status': 0, 'releaseId': 1, 'remotePhases': []}";
WebResource webresource = client1.resource("http://localhost:81/flex/services/rest/latest/cycle");
ClientResponse response = webresource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).post(ClientResponse.class, cycle);
String responseData =response.getEntity(String.class);
System.out.println(responseData);
我收到以下错误"POST http://localhost:81/flex/services/rest/latest/cycle returned a response status of 500 Internal Server Error"
。请告诉我代码中的错误是什么,或者是否需要在zephyr中设置任何配置
答案 0 :(得分:0)
请尝试使用POST请求以及参数:
POSThttp://localhost:80/flex/services/rest/latest/cycle/name=Cycle
有TCR阶段,如果此问题仍然存在,请告知我们