更新时间:2020-04-28 17:40
需要阿里云.NET SDK
String accessKeyId = "XXXXXXX";
String accessKeySecret = "XXXXXXXXXXXX";
DefaultProfile.AddEndpoint("cn-shanghai", "cn-shanghai", "Nlp", "nlp.cn-shanghai.aliyuncs.com");
IClientProfile profile = DefaultProfile.GetProfile("cn-shanghai", accessKeyId, accessKeySecret);
IAcsClient client = new DefaultAcsClient(profile);
String postBody = "{\n"
+ " \"text\": \"真丝韩都衣舍连衣裙\",\n"
+ "}";
CommonRequest request = new CommonRequest();
request.Domain = "nlp.cn-shanghai.aliyuncs.com";
request.UriPattern = "/nlp/api/wordpos/general";
request.Method = MethodType.POST;
request.SetContent(System.Text.Encoding.Default.GetBytes(postBody),"utf-8",FormatType.JSON);
request.AddHeadParameters("x-acs-signature-method", "HMAC-SHA1");
request.AddHeadParameters("x-acs-signature-nonce", System.Guid.NewGuid().ToString());
request.Action = "None";
request.Version = "2018-04-08";
CommonResponse response = client.GetCommonResponse(request);
Console.WriteLine(response.Data);
在文档使用中是否遇到以下问题
更多建议
匿名提交