DownloadTask.offHeadersReceived(listener: Function)

Requires:
BaseKit≥2.0.1
Platforms:
iOSAndroid

Description

Stop listening for HTTP Response Header events

Parameters

ParameterTypeRequiredDescription
YesEvent listener callback function

Return Value

None

Examples

import { downloadFile } from '@ray-js/ray'

// Remove the headers listener: first get the download task handle via ty.downloadFile, then register and remove the headers listener on the handle.
const downloadTask = await downloadFile({
  url: "https://airtake-public-data-1254153901.cos.ap-shanghai.myqcloud.com/ttttestfile/test_video.mp4",
});

const handler = e => {
  console.log(e);
};
downloadTask.onHeadersReceived(handler);
downloadTask.offHeadersReceived(handler);