Api/qualityprofiles/restore API, how to use it in java http request?

sonarqube
(yyh) #1
  1. sonarqube version: 6.7.6

api/qualityprofiles/restore, this api I use like this:

MultipartEntityBuilder=MultipartEntityBuilder.create();
builder.addBinaryBody(“backup”,new FileInputStream(file),ContentType.APPLICATION_XML,file.getName());
httpPost.setEntity(builder.build());

however it always return 400 and {“errors”:[{“msg”:“A backup file must be provided”}]}
I don’t know where the problem is . thanks a lot.