HomeDocs
Skip to main content

RequestTask

Introduction

Network request task object

Methods

Sample Code

// pages/index/index.js

Page({
request() {
const requestTask = dlt.request({
url: "xxx",
data: JSON.stringify({ x: "xx" }),
header: JSON.stringify({
"content-type": "application/json",
}),
success(res) {
console.log(res);
},
fail(res) {
console.error(res);
},
});
requestTask.abort(); // Cancel request task
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.