harmony 鸿蒙Upload and Download Subsystem Changelog
Upload and Download Subsystem Changelog
Compared with OpenHarmony 4.1.2.3, OpenHarmony 4.0 has the following API changes in the request subsystem.
cl.request.1 Removal of Error Code 21900005 task mode error
In earlier versions, the on(‘progress’), on(‘complete’), on(‘failed’), off(‘progress’), off(‘complete’), off(‘failed’), pause, and resume APIs take effect only for foreground tasks. In this version, they work for both foreground and background tasks. This means that, calling these APIs will no longer return the error code 21900005 task mode error.
Change Impact
Applications developed based on earlier versions may need to be adapted to the changed error codes. Otherwise, the service logic may be affected.
Key API/Component Changes
Module | Class | Method/Attribute/Enum/Constant | Change Type |
---|---|---|---|
ohos.request | Task | on(event: ‘progress’, callback: (progress: Progress) => void): void; | Changed |
ohos.request | Task | off(event: ‘progress’, callback?: (progress: Progress) => void): void; | Changed |
ohos.request | Task | on(event: ‘completed’, callback: (progress: Progress) => void): void; | Changed |
ohos.request | Task | off(event: ‘completed’, callback?: (progress: Progress) => void): void; | Changed |
ohos.request | Task | on(event: ‘failed’, callback: (progress: Progress) => void): void; | Changed |
ohos.request | Task | off(event: ‘failed’, callback?: (progress: Progress) => void): void; | Changed |
ohos.request | Task | pause(callback: AsyncCallback |
Changed |
ohos.request | Task | pause(): Promise |
Changed |
ohos.request | Task | resume(callback: AsyncCallback |
Changed |
ohos.request | Task | resume(): Promise |
Changed |
Adaptation Guide
Adapt the code based on the error code changes.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Distributed Device Management Subsystem Changelog
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦