tencentyun / cos-donet-sdk-v4 Goto Github PK
View Code? Open in Web Editor NEWcos-donet-sdk-v4
cos-donet-sdk-v4
腾讯云存储.NETStandard版本===> https://github.com/liuyl1992/TencentyunCos-dotnetStandard-sdk-v2.0
支持
.NET FrameWork4.6及以上
.NETCore 2.0及以上
.NETStandard2.0及以上
加个VS自动生成的 .gitignore 文件吧...
然后建议把Debug目录底下的文件从提交历史里删掉...
是dotnet不是donet
我克隆代码,修改代码中的AppID,SECRET_ID,SECRET_KEY,bucketName为我账户里的内容,,COSAPI_CGI_URL改成"http://tj.file.myqcloud.com/files/v2/",其它未作任何修改
然后编译,运行,结果不断得到异常,不能连通服务器!
经过捕获内部异常为:
Message "远程服务器返回错误: (403) 已禁止。" string
堆栈:
在 System.Net.HttpWebRequest.GetResponse()
在 QCloud.CosApi.Common.Request.SendRequest(String url, Dictionary2& data, HttpMethod requestMethod, Dictionary
2& header, Int32 timeOut, String localPath, Int64 offset, Int32 sliceSize)
位置 C:\Users\RoyLi\Source\Repos\cos-donet-sdk-v4\cos_dotnet_sdk\Common\Request.cs:行号 134
控制台输出:
{"code":-96,"message":"ERROR_PROXY_AUTH_EXPIRED","request_id":"NThkOWM3NDlfNmViMjM1XzczOGZfODAxM2I="}
整个过程唯一的可疑之处是我是用Net4.6.1框架编译的。难道这个SDK不支持Net4.6框架编译?求官方解答。
一直出现这个错误,查看数据是正确的,也是出现这个错误。。。。
依赖的json库Newtonsoft.Json要求.Net4.x,导致本sdk在某些场合不能直接使用,比如Unity。
可以考虑把COS的非核心功能进行接口抽象,比如抽象成IJson
、ILog
、IWeb
,
public interface IJson
{
string SerializeObject(object value);
JObject DeserializeObject(string str);
}
public interface ILog
{
void LogInfo(object s);
void Log(object s);
void LogWarning(object s);
void LogError(object s);
}
public interface IWeb
{
string UrlEncode(string url);
}
今天用这个SDK做创建目录测试的时候一直返回-59 ERROR_PROXY_S3_AUTH_EXPIRED错误。
问题及解决方案如下(懒得往git上提交代码)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.