Commandes CURL pour tester POST_userV2.php
📋 Format Linux/Mac/Bash
curl -X POST http://localhost/api/user/user/POST_userV2.php \
-H "Content-Type: application/json" \
-d @all_json/post_user_request.json
📋 Format Windows PowerShell
curl -X POST "http://localhost/api/user/user/POST_userV2.php" `
-H "Content-Type: application/json" `
-d "@all_json/post_user_request.json"
📋 Format Windows CMD
curl -X POST "http://localhost/api/user/user/POST_userV2.php" ^
-H "Content-Type: application/json" ^
-d "@all_json\post_user_request.json"
📋 Format avec chemin absolu
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
📋 Format avec données inline (sans fichier)
curl -X POST http://localhost/api/user/POST_userV2.php \
-H "Content-Type: application/json" \
-d '{
"firstName": "Jean",
"lastName": "Dupont",
"login": "test.user.1234567890@sipa-automobiles.fr",
"mail": "test.user.1234567890@sipa-automobiles.fr",
"dtContractStart": "2025-11-09T17:02:31",
"legalEntityId": 1,
"departmentId": 2,
"cultureID": 1036,
"rolePrincipalId": 4,
"employeeNumber": "TEST1234567890",
"managerId": 1919,
"birthDate": "1990-05-15T00:00:00",
"calendarId": null,
"habilitedRoles": [{"id": 3}],
"jobTitle": "Développeur Full Stack",
"gender": "Male"
}'
🚀 Exécution rapide
Windows PowerShell (depuis le dossier all_json):
cd all_json
.\send_curl_request.ps1
Linux/Mac:
cd all_json
chmod +x send_curl_request.sh
./send_curl_request.sh
⚠️ Notes importantes
- Assurez-vous que votre serveur web est démarré (Apache/Nginx ou
php -S localhost:8000)
- Le chemin du fichier JSON doit être correct (relatif ou absolu)
- Sur Windows, utilisez des guillemets doubles pour les chemins avec espaces
- Le
@ devant le nom de fichier indique à curl de lire le contenu du fichier