`) dans CMDREM Dans un terminal séparé, démarrer le serveur :
cd C:\Users\USER\Documents\Intersel\dev\Lucca
php -S localhost:8000 -t api
Puis dans un autre terminal :
cd C:\Users\USER\Documents\Intersel\dev\Lucca\all_json
curl -X POST "http://localhost:8000/user/user/POST_userV2.php" -H "Content-Type: application/json" -d "@post_user_request.json"
cd C:\Users\USER\Documents\Intersel\dev\Lucca\all_json
start_server_and_send.bat
Si vous avez déjà un serveur web (Apache/Nginx) sur le port 80 :
cd C:\Users\USER\Documents\Intersel\dev\Lucca\all_json
curl -X POST "http://localhost/api/user/user/POST_userV2.php" -H "Content-Type: application/json" -d "@post_user_request.json"
OU sur une seule ligne :
curl -X POST "http://localhost/api/user/user/POST_userV2.php" -H "Content-Type: application/json" -d "@C:\Users\USER\Documents\Intersel\dev\Lucca\all_json\post_user_request.json"
cd C:\Users\USER\Documents\Intersel\dev\Lucca\all_json
curl -X POST "http://localhost/api/user/user/POST_userV2.php" `
-H "Content-Type: application/json" `
-d "@post_user_request.json"
| Caractère | CMD | PowerShell |
|---|---|---|
| Continuation de ligne | ^ |
` |
| Guillemets | " |
" |
| Chemin | \ ou / |
\ ou / |
Exécutez simplement :
cd C:\Users\USER\Documents\Intersel\dev\Lucca\all_json
start_server_and_send.bat
Ce script va :