File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/xlang-api Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ x1 = Person{age:101}
7272`
7373
7474 result := kcl.MustRun (" hello.k" , kcl.WithCode (k_code)).First ()
75- fmt.Println (result.YAMLString ())
75+ fmt.Println (result.GetRawYAMLString ())
7676
7777 fmt.Println (" ----" )
7878 fmt.Println (" x0.name:" , result.Get (" x0.name" ))
@@ -187,14 +187,18 @@ The C-API provided by KCL does not have a REST-API. The REST-API is defined by P
187187The RestAPI service can be started in the following way:
188188
189189``` shell
190- python3 -m pip install kclvm -U
191- python3 -m gunicorn " kclvm.program.rpc-server.__main__:create_app()" -t 120 -w 4 -k uvicorn.workers.UvicornWorker -b :2021
190+ kcl server
192191```
193192
194193The service can then be requested via the POST protocol:
195194
196195``` shell
197- $ curl -X POST http://127.0.0.1:2021/api:protorpc/BuiltinService.Ping --data ' {}'
196+ curl -X POST http://127.0.0.1:2021/api:protorpc/BuiltinService.Ping --data ' {}'
197+ ```
198+
199+ The output is
200+
201+ ``` json
198202{
199203 "error" : " " ,
200204 "result" : {}
@@ -287,7 +291,3 @@ $ curl -X POST \
287291 }
288292}
289293```
290-
291- ## APIs in other languages
292-
293- Coming soon
Original file line number Diff line number Diff line change @@ -116,8 +116,7 @@ KCL 提供的 C-API 并没有 REST-API,REST-API 是通过 Protobuf 定义,
116116通过以下方式可以启动 RestAPI 服务:
117117
118118` ` ` shell
119- python3 -m pip install kclvm -U
120- python3 -m gunicorn "kclvm.program.rpc-server.__main__:create_app()" -t 120 -w 4 -k uvicorn.workers.UvicornWorker -b :2021
119+ kcl server
121120```
122121
123122然后可以通过 POST 协议请求服务:
You can’t perform that action at this time.
0 commit comments