我尝试使用下面的数据API更新资产。但是我无法更新它,它显示错误为错误请求。
String updateIssueData = "{\"Attributes\":{\"Status.Name\":{\"value\":"+"Done"+",\"act\":set}}}";
invokePostMethod("rest-1.v1/Data/Defect/1538",updateIssueData);
private static String invokePostMethod(String url, String data) throws AuthenticationException, ClientHandlerException {
Client client = Client.create();
WebResource webResource = client.resource(versionOneBaseURL+url);
ClientResponse response = webResource.header("Authorization", "Bearer " + fToken).type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class,data);
int statusCode = response.getStatus();
System.out.println("statuscode::"+statusCode);
return response.getEntity(String.class);
}