Skip to content

andrewsty/open-sdk-csharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

介绍

环境

.NET 4.0+
依赖System.Net.Http异步网络API

引用包

引用:System.Net.Http.dll
引用:open_sdk_csharp.dll

using YZOpenSDK;

如何使用?(参考README.md)

调用youzan.item.create接口

Auth auth = new Sign("${app_id}", "${app_secret}");
YZClient yzClient = new DefaultYZClient(auth);
Dictionary<string, object> dict = new System.Collections.Generic.Dictionary<string, object>();
dict.Add("title", "aaaaa");
dict.Add("price", 1.0);
dict.Add("post_fee", 1.0);

List<KeyValuePair<string, string>> files = new List<KeyValuePair<string, string>>();
// 仅作演示用,实际该API不支持传文件,具体参考API说明
files.Add(new KeyValuePair<string, string>("images[]", "/xx/xx/1.jpg"));

var result = yzClient.Invoke("youzan.item.create", "3.0.0", "post", dict, files);
Console.WriteLine(result);

调用youzan.items.onsale.get接口

Auth auth = new Token("xxx");
var result = yzClient.Invoke("youzan.items.onsale.get", "3.0.0", "get", dict, null);
Console.WriteLine(result);

License

Licensed under the MIT

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%