♻️ refactor(tsl): rebuild codegen taxonomy

Move generated builtin and dotnet function docs into the upgraded taxonomy, remove legacy route pages, and regenerate function_index.tsv from markdown headings.
This commit is contained in:
csh
2026-07-07 16:36:08 +08:00
parent 54c1c11e77
commit b6160676b4
763 changed files with 179921 additions and 154583 deletions
@@ -0,0 +1,216 @@
# 运行时 / 网络与HTTP
### `appendHttpHeader(session, header)`
向指定会话中添加请求头信息
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------ |
| `session` | any | Session ID |
| `header` | string | 要添加的请求头信息 |
返回:any
### `clearHttpHeader(session)`
清除会话中的请求头信息
| 参数 | 类型 | 说明 |
| --------- | ---- | -------------------------------------------------- |
| `session` | any | 可选参数,整数类型,session ID,缺省时指当前会话。 |
返回:any
### `createhttpsession(return_value)`
创建一个http Session对象,并返回会话ID,即Session id。仅新一代TSL语言支持该函数。
| 参数 | 类型 | 说明 |
| -------------- | ---- | -------------- |
| `return_value` | int | 返回session ID |
返回:intptr
### `destroyHttpSession(session, return_value)`
销毁一个Http Session对象,并返回销毁结果,销毁成功返回True。 仅新一代TSL语言支持该函数。
| 参数 | 类型 | 说明 |
| -------------- | ---- | -------------------------------------------------- |
| `session` | int | 可选参数,整数类型,Session ID,缺省时指当前会话。 |
| `return_value` | bool | object |
返回:bool
### `getHttp(session, url, time_out, value, code)`
网络访问以及相关函数相关函数。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---- |
| `session` | int | int |
| `url` | string | int |
| `time_out` | int | |
| `value` | string | |
| `code` | int | |
返回:bool
### `getHttpContent(session, frompos, return_value)`
获得HTTP返回的具体内容,可以从frompos开始取,缺省是取全部。 这个可以方便在progress回调函数中实现文件的临时存贮,亦可以动态打印内容。 仅新一代TSL语言支持该函数。
| 参数 | 类型 | 说明 |
| -------------- | ------ | --------------------------------------------------- |
| `session` | intptr | 指定session ID |
| `frompos` | int | 可选参数,指定开始位置,位置从1开始,缺省时指取全部 |
| `return_value` | int | 获取到的具体内容 |
返回:string
### `getHttpCookies(session)`
获取指定会话、来自服务器设置的Cookies信息
| 参数 | 类型 | 说明 |
| --------- | ---- | ---------- |
| `session` | any | Session ID |
返回:any
### `getHttpResponseHeader(session, return_value)`
获得HTTP返回的头信息,可以在header回调中看全部合成的header,也可以从已经完成会话的时候获得会话的头部信息。
| 参数 | 类型 | 说明 |
| -------------- | ------ | --------------------------------------------------------------------------- |
| `session` | int | 可选参数,指定session ID。缺省时指当前会话。仅新一代TSL语言支持该可选参数。 |
| `return_value` | string | 当前下载到的完整的头部信息 |
返回:string
### `internetRequest(session, url, refer, header, post_data, user_name, pass_word, result_type, response_code, time_out)`
发送Internet访问请求,主要用于Web建立网站。
| 参数 | 类型 | 说明 |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session` | int | 可选参数,整数类型,session ID,缺省时指当前会话。多次访问且需要使用同一条链路时,可指定为同个session ID。;注:旧版本TSL语言中,该参数含义为连接模式:0-微软WININET模式;1-TCP模式。 |
| `url` | string | 字符串类型,需要获取的URL串。如:`http://www.tinysoft.com.cn` |
| `refer` | int | 引用者。 |
| `header` | string | 发送请求的Http请求头。 |
| `post_data` | int | 发送的数据。 |
| `user_name` | int | 用户名。 |
| `pass_word` | string | 密码。 |
| `result_type` | string | 非0则Result返回Binary类型,为0则Result返回字符串类型。 |
| `response_code` | string | 存放返回的HTTP代码。例如,当正确的时候返回为200。 |
| `time_out` | string | 获取URL等待的毫秒数。 |
返回:bool
### `postHttp(session, url, content, time_out, value, code)`
以POST方式从指定的HTTP URL获得内容。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session` | int | 可选参数,整数类型,session ID,缺省时指当前会话。多次访问且需要使用同一条链路时,可指定为同个session ID。;注:旧版本TSL语言中,该参数含义为连接模式:0-微软WININET模式;1-TCP模式。 |
| `url` | string | 字符串类型,需要获取的URL串。如:`http://www.tinysoft.com.cn` |
| `content` | string | 二进制或字符串类型;要发送的数据。 |
| `time_out` | int | 获取URL等待的毫秒数。 |
| `value` | string | 存放返回的内容。 |
| `code` | int | 存放返回的HTTP代码。例如,当正确的时候返回为200。 |
返回:bool
### `setHttpAuth(session, user_name, pass_word, _type)`
设置指定会话中认证信息
| 参数 | 类型 | 说明 |
| ----------- | ------ | ------------------------------------------------------------ |
| `session` | any | Session ID |
| `user_name` | string | 用户名 |
| `pass_word` | string | 密码 |
| `_type` | any | 可选参数,认证信息类型;可多次调用以设置不同类型的认证信息: |
返回:any
### `setHttpCallBack(session, callback, t, return_value)`
设置http回调,缺省回调模式是progress模式,可以通过t设定为"header"设置头部回调函数。仅新一代TSL语言支持该函数。
| 参数 | 类型 | 说明 |
| -------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| `session` | int | session ID |
| `callback` | TFUNCTION | 函数对象,回调函数。可通过findfunction(functionname)方式获取 |
| `t` | string | 可选参数,设置进度回调或头部模式。 |
| `return_value` | 缺省模式,Progress模式指在HTTP请求\|响应传输过程中,实时追踪数据传输进度的回调机制 | 无 |
返回:回调函数的返回值为0表示继续,非0则结束请求
### `setHttpCookies(session, cookies)`
设置指定会话中Cookies信息
| 参数 | 类型 | 说明 |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `session` | any | Session ID |
| `cookies` | string | 要设置的Cookies值信息,多个Cookie以分号分隔,如SESSIONID=ABC123;THEME=DARK;一般无需设置,同一会话中发送的多次请求会自动携带服务器设置的Cookies |
返回:any
### `setHttpMode(session, mode, return_value)`
设置chunked模式(分段模式),主要用于大模型类的一个请求分段输出模式,支持类似于大模型一样按单词吐词输出。仅新一代TSL语言支持该函数。
| 参数 | 类型 | 说明 |
| -------------- | ---- | -------------------- |
| `session` | any | 指定session ID |
| `mode` | any | 输出模式,取值如下: |
| `return_value` | any | 无 |
返回:any
### `setHttpProxy(session, proxy_addr, proxy_type)`
设置指定会话中代理信息
| 参数 | 类型 | 说明 |
| ------------ | ------ | -------------------- |
| `session` | any | Session ID |
| `proxy_addr` | string | 代理地址 |
| `proxy_type` | any | 可选参数,代理类型: |
返回:any
### `setHttpVerifySsl(session, verify)`
设置指定会话是否校验服务器证书
| 参数 | 类型 | 说明 |
| --------- | ---- | ---------- |
| `session` | any | Session ID |
| `verify` | bool | object |
返回:any
## URL 内容函数
### `urlToText(a_src)`
将URL标准格式的串转化为文本字符串
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `a_src` | string | 字符串类型 |
返回:string
#### 示例
```tsl
a_src := "%23abcd%20%2010";
return urlToText(a_src);
// 结果:#abcd 10
```