We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
调用http://localhost:8080/kft-activiti-demo/rest/repository/deployments
调用代码 public static JsonNode deploy(String fileName, InputStream fileInputStream) throws IOException { HttpPost httpPost = new HttpPost( SERVER_URL_PREFIX + createRelativeResourceUrl(RestUrls.URL_DEPLOYMENT_COLLECTION)); Map<String, String> additionalFormFields = new HashMap<String, String>(); additionalFormFields.put(ActivitiConstants.TENANTID, OAConstants.TENANT_ID); httpPost.setEntity(HttpMultipartHelper.getMultiPartEntity(fileName, "application/xml", fileInputStream, null)); CloseableHttpResponse response = executeBinaryRequest(httpPost, HttpStatus.SC_CREATED); JsonNode responseNode = new ObjectMapper().readTree(response.getEntity().getContent()); closeResponse(response); return responseNode; } 异常信息 Exception in thread "main" java.lang.RuntimeException: {"message":"Bad request","exception":"Multipart request is required"} at com.asp.pt.activiti.rest.api.ActivitiHttpClient.internalExecuteRequest(ActivitiHttpClient.java:426) at com.asp.pt.activiti.rest.api.ActivitiHttpClient.executeBinaryRequest(ActivitiHttpClient.java:411) at com.asp.pt.activiti.rest.api.ActivitiHttpClient.deploy(ActivitiHttpClient.java:130) at com.asp.pt.activiti.rest.api.ActivitiHttpClient.main(ActivitiHttpClient.java:84)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
调用http://localhost:8080/kft-activiti-demo/rest/repository/deployments
调用代码
public static JsonNode deploy(String fileName, InputStream fileInputStream) throws IOException {
HttpPost httpPost = new HttpPost(
SERVER_URL_PREFIX + createRelativeResourceUrl(RestUrls.URL_DEPLOYMENT_COLLECTION));
Map<String, String> additionalFormFields = new HashMap<String, String>();
additionalFormFields.put(ActivitiConstants.TENANTID, OAConstants.TENANT_ID);
httpPost.setEntity(HttpMultipartHelper.getMultiPartEntity(fileName, "application/xml", fileInputStream, null));
CloseableHttpResponse response = executeBinaryRequest(httpPost, HttpStatus.SC_CREATED);
JsonNode responseNode = new ObjectMapper().readTree(response.getEntity().getContent());
closeResponse(response);
return responseNode;
}
异常信息
Exception in thread "main" java.lang.RuntimeException: {"message":"Bad request","exception":"Multipart request is required"}
at com.asp.pt.activiti.rest.api.ActivitiHttpClient.internalExecuteRequest(ActivitiHttpClient.java:426)
at com.asp.pt.activiti.rest.api.ActivitiHttpClient.executeBinaryRequest(ActivitiHttpClient.java:411)
at com.asp.pt.activiti.rest.api.ActivitiHttpClient.deploy(ActivitiHttpClient.java:130)
at com.asp.pt.activiti.rest.api.ActivitiHttpClient.main(ActivitiHttpClient.java:84)
The text was updated successfully, but these errors were encountered: