Java SDK 可通过 AccessKey/SecretKey 初始化。本文为您介绍初始化的操作步骤。
AK/SK 设置方法
Credential credential = new Credential(<分配的access_key_id>, <分配的secret_key>);
package com.kuaishou.example.demo;
import com.kuaishou.vod.core.Credential;
import com.kuaishou.vod.openapi.client.VodClient;
public class Demo {
public static void main(String[] args) throws Exception {
HttpProfile profile = HttpProfile.getDefault();
Credential credential = new Credential(<分配的access_key_id>, <分配的secret_key>);
VodClient client = new VodClient(profile, credential);
// call openapi
}
}