in the axios docs, it shows that you can POST an object directly through the data
parameter, thusly:
axios({
method: 'post',
url: 'someHandler.php',
data: {
id: 200,
sox: 'blue'
})
what i want to know is if you can PASS AN OBJECT into that data
parameter:
myObj = {
id: 200,
sox: 'blue'
}
axios({
method: 'post',
url: 'someHandler.php',
data: myObj
)
the above DOESN'T WORK, though it seems to me it should seeing as it's going to be JSON-encoded anyway. i've searched the docs, but can't find anything that answers this question.
i know that i can append myObj
to a formData
and pass it that way, but i want to know if i'm overlooking a simpler way.