跳到主要内容
版本:v10.0

M3D / M3D / Utility / HttpRequestWorker

Class: HttpRequestWorker

M3D.Utility.HttpRequestWorker

Http通信接口 多线程去发起http请求

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new HttpRequestWorker(): HttpRequestWorker

构造函数

Returns

HttpRequestWorker

Properties

callBack

callBack: any


endCallBack

endCallBack: any


errorCallBack

errorCallBack: any


startCallBack

startCallBack: any


xhr

xhr: XMLHttpRequest

Methods

cancle

cancle(): void

取消

Returns

void


request

request(method, url, async, requestParameters, onProcess): Promise<String | ArrayBuffer>

HTTP请求

Parameters

NameTypeDescription
methodstring请求的 HTTP 方法。值包括 GET、POST 和 HEAD
urlstring请求地址
asyncboolean请求使用应该异步地执行
requestParametersany附加参数,{"username":"", "password":"", "data":{}, "responseType":"", "requestHeader":{"name":"", "value":""}, "onProcess": function }
onProcessany-

Returns

Promise<String | ArrayBuffer>