BS调用样式

老引擎调用方式

无key

http://192.168.1.62:8887/translate?content=%E6%88%91%E7%88%B1%E6%88%91%E7%9A%84%E5%9B%BD%E5%AE%B6&from=zh&to=en&debug=1

{
    "translation": "",
    "errmsg": "出错啦~请输入有效参数值(errcode=951220)"
}

有key

http://192.168.1.62:8887/translate?content=%E6%88%91%E7%88%B1%E6%88%91%E7%9A%84%E5%9B%BD%E5%AE%B6&from=zh&to=en&key=1111

{
    "translation": "I love my country.",
    "errmsg": ""
}

debug参数置1:

http://192.168.1.62:8887/translate?content=%E6%88%91%E7%88%B1%E6%88%91%E7%9A%84%E5%9B%BD%E5%AE%B6&from=zh&to=en&debug=1&key=1111

txt: 我爱我的国家
params: type=cnen;outfmt=txt;key=111;serv_addr=
{
    "result": "{ \"translation\": \"I love my country.\", \"errmsg\": \"\" }",
    "sid": "",
    "client": "192.168.1.2",
    "lxmode": true,
    "appid": "",
    "debug": true,
    "params": "type=cnen;outfmt=txt;key=111;serv_addr=",
    "date": "2016-08-08 19:04:17",
    "type": "cnen",
    "txt": "我爱我的国家",
    "method": "Get",
    "server": "172.17.42.1",
    "dssmode": true,
    "outfmt": "txt",
    "key": "111",
    "resp": 115
}
{
    "translation": "I love my country.",
    "errmsg": ""
}

新引擎调用方式:

outfmt=txt

http://192.168.1.62:8887/translate?params=outfmt=txt;type=cnen&txt=%E6%88%91%E7%88%B1%E6%88%91%E7%9A%84%E5%9B%BD%E5%AE%B6&key=111111

I love my country.

outfmt=json

http://192.168.1.62:8887/translate?params=outfmt=json;type=cnen&txt=%E6%88%91%E7%88%B1%E6%88%91%E7%9A%84%E5%9B%BD%E5%AE%B6&key=111111

{
    "from": "cn",
    "to": "en",
    "result": [
        {
            "src": "我爱我的国家",
            "dst": "I love my country."
        }
    ]
}

无key

http://192.168.1.62:8887/translate?params=outfmt=json;type=cnen&txt=%E6%88%91%E7%88%B1%E6%88%91%E7%9A%84%E5%9B%BD%E5%AE%B6

{
    "translation": "",
    "errmsg": "出错啦~请输入有效参数值(errcode=951220)"
}

你可能感兴趣的:(itrans)