mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-27 01:11:35 +00:00
上传下载 支持监听任务响应头 新增接口
Signed-off-by: hu-kai45 <hukai45@huawei.com>
This commit is contained in:
parent
4a717bb612
commit
701446e11e
64
api/@ohos.request.d.ts
vendored
64
api/@ohos.request.d.ts
vendored
@ -4033,6 +4033,52 @@ declare namespace request {
|
||||
readonly extras?: object;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP response.
|
||||
*
|
||||
* @interface HttpResponse
|
||||
* @syscap SystemCapability.Request.FileTransferAgent
|
||||
* @since 12
|
||||
*/
|
||||
interface HttpResponse {
|
||||
/**
|
||||
* The version of the HTTP response.
|
||||
*
|
||||
* @type { string }
|
||||
* @readonly
|
||||
* @syscap SystemCapability.Request.FileTransferAgent
|
||||
* @since 12
|
||||
*/
|
||||
readonly version: string,
|
||||
/**
|
||||
* The status code of the HTTP response.
|
||||
*
|
||||
* @type { number }
|
||||
* @readonly
|
||||
* @syscap SystemCapability.Request.FileTransferAgent
|
||||
* @since 12
|
||||
*/
|
||||
readonly statusCode: number,
|
||||
/**
|
||||
* The reason of the HTTP response.
|
||||
*
|
||||
* @type { string }
|
||||
* @readonly
|
||||
* @syscap SystemCapability.Request.FileTransferAgent
|
||||
* @since 12
|
||||
*/
|
||||
readonly reason: string,
|
||||
/**
|
||||
* The headers of the HTTP response.
|
||||
*
|
||||
* @type { Map<string, Array<string>> }
|
||||
* @readonly
|
||||
* @syscap SystemCapability.Request.FileTransferAgent
|
||||
* @since 12
|
||||
*/
|
||||
readonly headers: Map<string, Array<string>>,
|
||||
}
|
||||
|
||||
/**
|
||||
* The task entry.
|
||||
* New task' status is "initialized" and enqueue.
|
||||
@ -4290,6 +4336,24 @@ declare namespace request {
|
||||
* @since 11
|
||||
*/
|
||||
off(event: 'remove', callback?: (progress: Progress) => void): void;
|
||||
/**
|
||||
* Enables the response callback.
|
||||
*
|
||||
* @param { 'response' } event - event types.
|
||||
* @param { Callback<HttpResponse> } callback - callback function with an `HttpResponse` argument.
|
||||
* @syscap SystemCapability.Request.FileTransferAgent
|
||||
* @since 12
|
||||
*/
|
||||
on(event: 'response', callback: Callback<HttpResponse>): void;
|
||||
/**
|
||||
* Disables the response callback.
|
||||
*
|
||||
* @param { 'response' } event - event types.
|
||||
* @param { Callback<HttpResponse> } callback - callback function with an `HttpResponse` argument.
|
||||
* @syscap SystemCapability.Request.FileTransferAgent
|
||||
* @since 12
|
||||
*/
|
||||
off(event: 'response', callback?: Callback<HttpResponse>): void;
|
||||
/**
|
||||
* Starts the task.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user