fetch发请求

 fetch('/galaxy/query', {

                  method:'POST',
                  headers:{
                     'Content-Type': 'application/json'
                  },
                  body:JSON.stringify({
                    city:formitem.city,
                    date:formitem.date,
                    condition:formitem.station,
                  })
                }).then(data => data.json())
                .then(data => {
                  console.log(data);

                })

fetch('/galaxy/query?topicURL=${this.topicURL}', {

                  method:'GET',
                  headers:{
                     'Content-Type': 'application/json'
                  },
                  body:JSON.stringify({
                    city:formitem.city,
                    date:formitem.date,
                    condition:formitem.station,
                  })
                }).then(data => data.json())
                .then(data => {
                  console.log(data);

                })

http://www.jianshu.com/p/75a18e565f33

http://bubkoo.com/2015/05/08/introduction-to-fetch/

https://jakearchibald.com/2015/thats-so-fetch/


你可能感兴趣的:(javascript,vue.js)