Skip to content

Methods

Fatih Koca edited this page Nov 27, 2019 · 1 revision

The HTTP method to use for the request (e.g. "get", "post", "put").

Default value is get.

Available methods: get, post, put, delete, patch, head, jsonp.

Get

Vue.ajax({
    url: "http://example.com",
    method: "get"
});

// The shorthand method:
Vue.ajax.get("http://example.com", {});

Post

Vue.ajax({
    url: "http://example.com",
    method: "post"
});

// The shorthand method:
Vue.ajax.post("http://example.com", {});

Put

Vue.ajax({
    url: "http://example.com",
    method: "put"
});

// The shorthand method:
Vue.ajax.put("http://example.com", {});

Delete

Vue.ajax({
    url: "http://example.com",
    method: "delete"
});

// The shorthand method:
Vue.ajax.delete("http://example.com", {});

Patch

Vue.ajax({
    url: "http://example.com",
    method: "patch"
});

// The shorthand method:
Vue.ajax.patch("http://example.com", {});

Head

Vue.ajax({
    url: "http://example.com",
    method: "head"
});

// The shorthand method:
Vue.ajax.head("http://example.com", {});

Jsonp

Vue.ajax({
    url: "http://example.com",
    method: "jsonp"
});

// The shorthand method:
Vue.ajax. jsonp("http://example.com", {});
Clone this wiki locally