request
发送http请求
GET
import { network } from 'waft';const obj = new JSONObject();obj.set('url','https://xxx.xxx.com');obj.set('method','GET');// obj.set('headers','');network.request(obj.toString(), (result: JSONObject):void => {console.log('---> result: ' + result.toString());});
POST
import { network } from 'waft';const obj = new JSONObject();obj.set('url','https://xxx.xxx.com');obj.set('method','POST'); // 目前只支持GETconst data = new JSONObject();data.set("name", "xiaoming");obj.set('data',data);network.request(obj.toString(), (result: JSONObject):void => {console.log('---> result: ' + result.toString());});
