## uni.request(OBJECT)
發起網絡請求。
**OBJECT 參數說明**

**success 返回參數說明**

**data 數據說明**
最終發送給服務器的數據是 String 類型,如果傳入的 data 不是 String 類型,會被轉換成 String。轉換規則如下:
對于 GET 方法,會將數據轉換為 query string。例如 { name: 'name', age: 18 } 轉換后的結果是 name=name&age=18。
對于 POST 方法且 header['content-type'] 為 application/json 的數據,會進行 JSON 序列化。
對于 POST 方法且 header['content-type'] 為 application/x-www-form-urlencoded 的數據,會將數據轉換為 query string。
示例
```
uni.request({
url: 'https://www.example.com/request', //僅為示例,并非真實接口地址。
data: {
name: 'name',
age: 18
},
header: {
'custom-header': 'hello' //自定義請求頭信息
},
success: function (res) {
console.log(res.data);
}
});
```
返回值
返回一個 requestTask 對象,通過 requestTask,可中斷請求任務。

示例
```
const requestTask = uni.request({
url: 'https://www.example.com/request', //僅為示例,并非真實接口地址。
data: {
name: 'name',
age: 18
},
success: function (res) {
console.log(res.data);
}
});
// 中斷請求任務
requestTask.abort();
```
Tips
請求的 header 中 content-type 默認為 application/json。