TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AliyunViapiOcrCharacterRequest req = new AliyunViapiOcrCharacterRequest();
req.setImageUrl("http://xx.xxx.com/a.jpeg");
req.setImageType(0L);
req.setMinHeight(10L);
req.setOutputProbability(true);
AliyunViapiOcrCharacterResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AliyunViapiOcrCharacterRequest req = new AliyunViapiOcrCharacterRequest();
req.ImageUrl = "http://xx.xxx.com/a.jpeg";
req.ImageType = 0L;
req.MinHeight = 10L;
req.OutputProbability = true;
AliyunViapiOcrCharacterResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AliyunViapiOcrCharacterRequest;
$req->setImageUrl("http://xx.xxx.com/a.jpeg");
$req->setImageType("0");
$req->setMinHeight("10");
$req->setOutputProbability("true");
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=aliyun.viapi.ocr.character' \
-d 'partner_id=apidoc' \
-d 'sign=2431F02627E3299D71A22619558C5E13' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-28+16%3A49%3A58' \
-d 'v=2.0' \
-d 'image_type=0' \
-d 'image_url=http%3A%2F%2Fxx.xxx.com%2Fa.jpeg' \
-d 'min_height=10' \
-d 'output_probability=true'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AliyunViapiOcrCharacterRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.image_url="http://xx.xxx.com/a.jpeg"
req.image_type=0
req.min_height=10
req.output_probability=true
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"aliyun.viapi.ocr.character");
add_param(pRequest,"image_url","http://xx.xxx.com/a.jpeg");
add_param(pRequest,"image_type","0");
add_param(pRequest,"min_height","10");
add_param(pRequest,"output_probability","true");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('aliyun.viapi.ocr.character', {
'image_url':'http://xx.xxx.com/a.jpeg',
'image_type':'0',
'min_height':'10',
'output_probability':'true'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})