vue - resource

github地址:https://github.com/pagekit/vue-resource/blob/develop/docs/http.mdvue

 

經常使用請求:git

1. get請求: 格式 url?request=textgithub

this.$http.get(url + text).then((response) => {
response = response.body;
});

2. get請求: 格式 url?request={"start_page":xxx,"page_size":xxx}vue-resource

this.$http({
method: 'get',
url: globals.URL,
params: {request: {start_page: 1,page_size:10}},
emulateJSON: true
}).then((response) => {
    response = respons.body;
});

3. post請求: post

this.$http.post(url ,{name:'admin',password:'123'}).then((response) => {
response = response.body;
});
相關文章
相關標籤/搜索