[Vuejs]-How to pass object in http.send() function?

1👍

It seems to me that your issue is that you are trying to send a whole object instead of JSON. The correct way to do this would be to use http.send(JSON.stringify(params))

👤Lilith

1👍

1👍

You can use the new fetch API for this, makes it dead easy and less code

// Call the fetch function passing the url of the API as a parameter
fetch(url) 
.then(function(response) {
    // Your code for handling the data you get from the API
})
.catch(function() {
    // This is where you run code if the server returns any errors
});

Also if your a newbie it will get things working quicker and help you solve your problem faster.

Leave a comment