This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
component:internet:zh [2023/11/05 10:53] hfsr [TCP套接字对象] |
component:internet:zh [2023/11/05 10:56] (current) hfsr [HTTP请求对象] |
||
---|---|---|---|
Line 33: | Line 33: | ||
确认套接字已连接。若连接失败会报错。 | 确认套接字已连接。若连接失败会报错。 | ||
\\ | \\ | ||
- | - `id():string` | + | - `id():string` |
- | 返回此套接字的ID。 | + | 返回此套接字的ID。 |
- | \\ | + | |
在调用`finishConnect`或者`read`后,套接字会在有新数据可供读取时产生一个名为`internet_ready`的信号。此信号有一个参数,代表套接字ID。 | 在调用`finishConnect`或者`read`后,套接字会在有新数据可供读取时产生一个名为`internet_ready`的信号。此信号有一个参数,代表套接字ID。 | ||
====HTTP请求对象==== | ====HTTP请求对象==== | ||
- `read([n:number]):string` | - `read([n:number]):string` | ||
- | Tries to read data from the response. Returns the read byte array. | + | 尝试从响应中读取数据。返回读取到的字节数组。 |
+ | \\ | ||
- `response():number, string, table` | - `response():number, string, table` | ||
- | Get response code, message and headers. | + | 获取响应码、响应信息与响应头。 |
+ | \\ | ||
- `close()` | - `close()` | ||
- | Closes an open socket stream. | + | 关闭某个已打开的套接字流。 |
+ | \\ | ||
- `finishConnect():boolean` | - `finishConnect():boolean` | ||
- | Ensures a response is available. Errors if the connection failed. | + | 确认套接字已连接。若连接失败会报错。 |
目录 | 目录 |