A
A
Alexander Ivanov2019-02-14 09:25:57
Vue.js
Alexander Ivanov, 2019-02-14 09:25:57

How to pass json via axios to vue?

https://stackoverflow.com/questions/45347112/vuejs...
Tried both post and path but something is wrong

create(){
            var obj = {
                "title": this.title
            }
            this.$http.path(
                url,
                obj, 
                { headers: {
                    Authorization: `Bearer ${localStorage.getItem('token')}` }
                }
            ).then(({ data }) => {
                console.log(data)
                alert('tadam')
            });
        },

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2019-02-14
@cimonlebedev

Strange only through put it worked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question