CURL_COMMANDS.md 2.1 KB

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

  1. Assurez-vous que votre serveur web est démarré (Apache/Nginx ou php -S localhost:8000)
  2. Le chemin du fichier JSON doit être correct (relatif ou absolu)
  3. Sur Windows, utilisez des guillemets doubles pour les chemins avec espaces
  4. Le @ devant le nom de fichier indique à curl de lire le contenu du fichier