diff --git a/zh-cn/application-dev/reference/apis/js-apis-socket.md b/zh-cn/application-dev/reference/apis/js-apis-socket.md index f01fd47aa836044fccd805b3347df38063f216dd..1659644ba57a226828422a0d1576acda37a64000 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-socket.md +++ b/zh-cn/application-dev/reference/apis/js-apis-socket.md @@ -2528,4 +2528,4 @@ TLS通信的协议版本。 | 类型 | 说明 | | --------------------------------------------------------------------- | --------------------- | -|[cryptoFramework.EncodingBlob](js-apis-cryptoFramework.md#EncodingBlob) | 存储证书的数据和编码格式 | \ No newline at end of file +|[cryptoFramework.EncodingBlob](js-apis-cryptoFramework.md#datablob) | 存储证书的数据和编码格式 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-fetch.md b/zh-cn/application-dev/reference/apis/js-apis-system-fetch.md index a9448693b273ae3b3869747342b580e012f7d0c5..f6c7b4b5eb360d1bf4cf18c3ddd37450445be811 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-fetch.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-fetch.md @@ -20,8 +20,6 @@ fetch(Object): void 通过网络获取数据。 -**需要权限:** ohos.permission.INTERNET - **系统能力:** SystemCapability.Communication.NetStack **参数:** @@ -32,7 +30,7 @@ fetch(Object): void | header | Object | 否 | 设置请求的header。 | | method | string | 否 | 请求方法默认为GET,可选值为:OPTIONS、GET、HEAD、POST、PUT、DELETE、TRACE。 | | responseType | string | 否 | 默认会根据服务器返回header中的Content-Type确定返回类型,支持文本和json格式。详见success返回值。 | -| success | Function | 否 | 接口调用成功的回调函数。 | +| success | Function | 否 | 接口调用成功的回调函数,返回值为[FetchResponse](#fetchresponse) | | fail | Function | 否 | 接口调用失败的回调函数。 | | complete | Function | 否 | 接口调用结束的回调函数。 | @@ -45,7 +43,7 @@ fetch(Object): void | Object | 不设置 | Content-Type默认为application/x-www-form-urlencoded,data按照资源地址规则进行encode拼接作为请求的body。 | | Object | application/x-www-form-urlencoded | data按照资源地址规则进行encode拼接作为请求的body。 | -success返回值: +## FetchResponse | 参数名 | 类型 | 说明 | | -------- | -------- | -------- | diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-network.md b/zh-cn/application-dev/reference/apis/js-apis-system-network.md index f269ebc2d45d845eb1ddd7c8274598ac6476eb29..7ac1f1ea18ba295deea28cfa49a3cd49018d6b7b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-network.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-network.md @@ -33,17 +33,10 @@ getType(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | +| success | Function | 否 | 接口调用成功的回调函数,返回值为[NetworkResponse](#networkresponse) | | fail | Function | 否 | 接口调用失败的回调函数。 | | complete | Function | 否 | 接口调用结束的回调函数。 | -success返回值: - -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| metered | boolean | 是否按照流量计费。 | -| type | string | 网络类型,可能的值有2g,3g,4g,5g,wifi,none等。 | - fail返回值: | 错误码 | 说明 | @@ -80,16 +73,9 @@ subscribe(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 网络发生变化的回调函数。 | +| success | Function | 否 | 网络发生变化的回调函数,返回值为[NetworkResponse](#networkresponse) | | fail | Function | 否 | 接口调用失败的回调函数。 | -success返回值: - -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| metered | boolean | 是否按照流量计费。 | -| type | string | 网络类型,可能的值为2g,3g,4g,5g,wifi,none。 | - fail返回值: | 错误码 | 说明 | @@ -131,4 +117,12 @@ export default { network.unsubscribe(); }, } -``` \ No newline at end of file +``` + + +## NetworkResponse + +| 参数名 | 类型 | 说明 | +| -------- | -------- | -------- | +| metered | boolean | 是否按照流量计费。 | +| type | string | 网络类型,可能的值有2g,3g,4g,5g,wifi,none等。 | \ No newline at end of file