[Vuejs]-Vue Axios doesnt return response

2👍

I am using axios PUT this way and it works well..

axios.put("http://example.org", "plaintextbodyorstringifiedmaybe", {headers: {"Content-Type": "text/plain"}}).then(response => (console.log(response.data)))

1👍

Vue.axios.put("http://localhost:4000/api/" + this.$route.params.id)
    .then((res) => {
     console.log(res);

0👍

An HTTP PUT response has an empty body HTTP PUT on MDN

In case of a successful request, the response body is empty, whereas a successful POST request’s response has a body HTTP POST on MDN

👤Jost

Leave a comment