send_curl_request.ps1 693 B

123456789101112131415161718192021
  1. # Script PowerShell pour envoyer la requête POST avec curl
  2. # Format Windows PowerShell
  3. $jsonFile = Join-Path $PSScriptRoot "post_user_request.json"
  4. $url = "http://localhost/api/user/user/POST_userV2.php"
  5. Write-Host "🚀 Envoi de la requête POST..." -ForegroundColor Yellow
  6. Write-Host "📄 Fichier JSON: $jsonFile" -ForegroundColor Cyan
  7. Write-Host "🌐 URL: $url" -ForegroundColor Cyan
  8. Write-Host ""
  9. # Commande curl formatée pour Windows
  10. $curlCommand = "curl -X POST `"$url`" -H `"Content-Type: application/json`" -d `"@$jsonFile`""
  11. Write-Host "📋 Commande curl:" -ForegroundColor Green
  12. Write-Host $curlCommand
  13. Write-Host ""
  14. # Exécuter la commande
  15. Invoke-Expression $curlCommand