# sendHttpRequest ^5.1.2
weex 发送网络请求
# 请求参数
Prop | Type | Required | Default | Description |
---|---|---|---|---|
options | Object | Y | {} | 请求参数 |
# 接口调用示例
this.$bridge
.sendHttpRequest(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
- 调用示例:
export default {
...
methods: {
click() {
let params = {
data: {}
options: {}
};
this.$bridge
.sendHttpRequest(params)
.then((resp) => {
//执行自定义逻辑
}, (error) => {
console.log("error");
});
}
}
...
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 返回参数
- N/A