M3D / M3D / Utility / HttpConnect
Class: HttpConnect
单个Http通信连接基础方法封装,包括get、post通信方式
Table of contents
Constructors
Methods
Constructors
constructor
• new HttpConnect(): HttpConnect
构造函数
Returns
Methods
getCurrentUrl
▸ getCurrentUrl(): string
Returns
string
httpCancle
▸ httpCancle(): void
取消终止
Returns
void
request
▸ request(method
, url
, async
, requestParameters
, onProcess
): Promise
<String
| ArrayBuffer
>
HTTP请求
Parameters
Name | Type | Description |
---|---|---|
method | string | 请求的 HTTP 方法。值包括 GET、POST 和 HEAD |
url | string | 请求地址 |
async | boolean | 请求使用应该异步地执行 |
requestParameters | any | 附加参数,{"username":"", "password":"", "data":{}, "responseType":"", "requestHeader":{"name":"", "value":""}, "onProcess": function } |
onProcess | any | - |
Returns
Promise
<String
| ArrayBuffer
>