前端获取http状态码400的返回值实例_基础教程


本文摘自PHP中文网,作者亚连,侵删。

下面我就为大家带来一篇前端获取http状态码400的返回值实例。现在就分享给大家,也给大家做个参考。

如下所示:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

axios.get("/check_mobile_and_sent_code",{withCredentials:true,params:{mobile:formInline.mobile}}).then(res=>{

            console.log(res);

            //if(res.result==true){

              if (!this.timer) {

                this.count = this.TIME_COUNT;

                this.show = false;

                this.timer = setInterval(() => {

                  if (this.count > 0 && this.count <= this.TIME_COUNT) {

                    this.count--;

                  } else {

                    this.show = true;

                    clearInterval(this.timer);

                    this.timer = null;

                  }

                }, 1000)

              }

            //}

          }).catch(error=>{

            console.log(error.response.data);

            console.log(error.response.status);

            console.log(error.response.headers);

            console.log('Error', error.message);

            console.log(error.config);

          })

使用场景:

阅读剩余部分

相关阅读 >>

HTTP请求的常用方法有哪些

用 // 代替 的好处

什么是HTTPHTTP请求方式和传递数据类型是什么?

HTTP状态代码是什么

分析影响HTTP性能的常见因素

前端开发紧密相关的HTTP协议知识

HTTP的方法,状态码和组成部分

前端获取HTTP状态码400的返回值实例_基础教程

一次性搞懂 HTTPHTTPs、spdy、HTTP2

HTTP和html分别指什么

更多相关阅读请进入《HTTP》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...