0👍
I had to convert it to a php object first
<?php
require 'vendor/autoload.php';
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 1000");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Cache-Control, Pragma, Authorization, Accept, Accept-Encoding");
header("Access-Control-Allow-Methods: PUT, POST, GET, OPTIONS, DELETE");
// takes raw data from the request
$json = file_get_contents('php://input');
// Converts it into a PHP object
$data = json_decode($json, true);
$client = new MongoDB\Client("mongodb://localhost:27017");
$collection = $client->dev->customers;
$collection->insertOne($data);
?>
- [Vuejs]-SignInSuccessUrl of firebaseUI not work for me
- [Vuejs]-How to get the API response into my listrendering in vue 3?
Source:stackexchange.com