use of com.tencentcloudapi.essbasic.v20201222.EssbasicClient in project tencentcloud-sdk-java by TencentCloud.
the class UploadFiles method main.
public static void main(String[] args) {
try {
ClientProfile cp = new ClientProfile();
HttpProfile hp = new HttpProfile();
hp.setEndpoint(FileEndPoint);
cp.setHttpProfile(hp);
EssbasicClient client = new EssbasicClient(new Credential(Ak, Sk), "ap-guangzhou", cp);
UploadFilesRequest request = new UploadFilesRequest();
Caller caller = new Caller();
caller.setApplicationId(Appid);
caller.setOperatorId(OperatorId);
request.setCaller(caller);
request.setBusinessType("FLOW");
UploadFile[] fileInfos = new UploadFile[1];
request.setFileInfos(fileInfos);
UploadFile file = new UploadFile();
fileInfos[0] = file;
file.setFileName("************");
file.setFileBody(getFileBody());
request.setCoverRect(false);
UploadFilesResponse response = client.UploadFiles(request);
System.out.println(client.gson.toJson(response));
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations