地域 | 接入地址 |
---|---|
上海 | nlp.cn-shanghai.aliyuncs.com |
支持通过 HTTP 或 HTTPS 通道进行请求通信。为了获得更高的安全性,推荐您使用 HTTPS 通道发送请求。
请求体为json结构字符串,服务返回也为json字符串,具体要求参考各API文档,示例请求(java):
public class SampleRequest {
public static void main(String[] args) {
String serviceURL = "http://nlp.cn-shanghai.aliyuncs.com/nlp/api/wordsegment/general";
String accessKeyId = "yourAccessKeyId";
String accessKeySecret = "yourAccessKeySecret";
String postBody =
"{\n" +
" \"text\": \"裙子穿着很美哦,上身效果也不错,是纯棉的料子,穿这也很舒服。宽松的版型有点 娃娃裙的感觉,穿起来萌萌哒、挺可爱的,男票说好看哦,哈哈\",\n" +
" \"lang\": \"ZH\"\n" +
"}";
// Sender代码请参考帮助文档“签名方法”
String result = Sender.sendPost(serviceURL, postBody, accessKeyId, accessKeySecret);
System.out.println(result);
}
}
请求正常结果,为json字符串。
{"errorCode":"errorCode","errorMsg":"错误消息"}
请求长度限制请参考具体API。
请求及返回结果都使用 UTF-8 字符集进行编码。
在文档使用中是否遇到以下问题
更多建议
匿名提交