tennessgo-web

command module
v0.0.0-...-ef8ff1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

README

TennessGo-Web

GitHub CircleCI

github.com/z-t-y/tennessgo进行封装,实现Web API接口,网址为tg-web.herokuapp.com

简易文档

由于此Web API非常简单,我觉得就无需详尽的文档了,在此做简单说明即可。

概述
GET方法

样例:

curl https://tg-web.herokuapp.com/api

返回:

{
    "description": "处理不规范中文句子的Web API",
    "name": "Tennessine-Go API"
}
POST方法
  • Content-Type: application/json

样例:

curl -d '{"to_translate":"发生甚么事了是啥意思"}' https://tg-web.herokuapp.com/api

返回:

{
    "to_translate": "发生甚么事了是啥意思",
    "translated": "发生甚么事了是什么意思"
}

如果to_translate为空字符串或不存在,为方便AJAX使用,不会返回异常状态

而会返回

{
    "error": "error message", // 是具体报错情况而定
    "translated": ""
}

提示:如果想要为Tennessine-Go构建客户端程序,则可以对error是否为空进行判断

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL