七牛测试地址怎么配置?没有文档呢,是少了什么配置么?

七牛测试地址怎么配置?没有文档呢,报错了,UploadManager怎么知道上传的请求地址?测试地址又是干嘛的?
com.qiniu.common.QiniuException

at com.qiniu.http.Client.send(Client.java:202)
at com.qiniu.http.Client.multipartPost(Client.java:175)
at com.qiniu.http.Client.multipartPost(Client.java:143)
at com.qiniu.storage.FormUploader.upload(FormUploader.java:52)
at com.qiniu.storage.UploadManager.put(UploadManager.java:126)
at com.qiniu.storage.UploadManager.put(UploadManager.java:104)

执行到 Response response= uploadManager.put(data, key, token);时报错,
代码:
public static boolean upLoadFile(byte[] data,String key){

    try {
        System.out.println("######data.length: "+data.length);
        if(data.length==0)throw new RuntimeException("上传文件内容为空");
        UploadManager uploadManager=new UploadManager();
        String token=getUptoken(key);
        Response response= uploadManager.put(data, key, token);
        System.out.println("##########Response: "+response.isOK());
        return true;
    } catch (QiniuException e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
    }
    return false;
}
查看回复

相关问答