When sending an object from this.productDetails
in an axios.post()
request, I noticed that the object appears empty when inspected in the browser's network tab.
Here's the Axios call:
async addProduct(){
console.log('product_details', this.productDetails)
const apiResponse = await axios.post('add_product',{
productDetails : this.productDetails
})
const response = apiResponse.data
},
Despite logging the object using
console.log('product_details', this.productDetails)
, which shows that it contains the actual object: https://i.sstatic.net/SlhLP.png
This is my Laravel route:
Route::post('add_product',[PackageSubscriptionController::class, 'addProduct']);
Here's the Network: https://i.sstatic.net/eCCQD.png