Closed dduo518 closed 5 years ago
u,_:=url.Parse("http://xxx-dev-1xxx.cos.ap-xxx.myqcloud.com") b := &cos.BaseURL{BucketURL: u} client := cos.NewClient(b, &http.Client{ Transport: &cos.AuthorizationTransport{ SecretID: "xxx", SecretKey: "xxx", }, }) opt := &cos.ObjectPutOptions{ ObjectPutHeaderOptions: &cos.ObjectPutHeaderOptions{ ContentType: fileType, ContentLength:len(content), }, ACLHeaderOptions: &cos.ACLHeaderOptions{ XCosACL: "private", }, } name := "test/objectPut.go" f := strings.NewReader("test") _, err := client.Object.Put(context.Background(), name, f, nil) log.Println(err)
上传失败 返回下面错误:
2019/08/25 16:50:57 Put /test%2FobjectPut.go: unsupported protocol scheme "”
上传失败 返回下面错误: