Fork me on github

请求链接(测试使用)

1.侃爷语录(get请求)

  axiosGet () {
      axios.get('https://api.kanye.rest/').then(response => {
        this.quote = response.data.quote
      }).catch(err => {
        console.log(err)
      })
    },

 2.post请求

    createPost () {
      axios.post('https://jsonplaceholder.typicode.com/posts', JSON.stringify({
        title: 'foo',
        body: 'bar',
        userId: 1
      })).then(response => {
        console.log(response)
      })
    },

 

posted @ 2021-05-21 13:46  我の前端日记  阅读(95)  评论(0)    收藏  举报
Copyright © 2021 LinCangHai
Powered by .NET 5.0 on Kubernetes