vue - resource
github地址:https://github.com/pagekit/vue-resource/blob/develop/docs/http.md
常用请求:
1. get请求: 格式 url?request=text
this.$http.get(url + text).then((response) => {
response = response.body;
});
2. get请求: 格式 url?request={"start_page":xxx,"page_size":xxx}
this.$http({
method: 'get',
url: globals.URL,
params: {request: {start_page: 1,page_size:10}},
emulateJSON: true
}).then((response) => {
response = respons.body;
});
3. post请求:
this.$http.post(url ,{name:'admin',password:'123'}).then((response) => {
response = response.body;
});