test-cloudfunc.ps1 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # Test the deployed cloud functions
  2. $ct = @{ "Content-Type" = "application/json" }
  3. # Test getApigInfo (t012qy4XVe)
  4. Write-Host "=== getApigInfo ===" -ForegroundColor Cyan
  5. $body1 = @{
  6. _ApplicationId = "ncloudmaster"
  7. apigId = "Vo3ROWEvDy"
  8. } | ConvertTo-Json -Compress
  9. try {
  10. $r1 = Invoke-RestMethod -Uri "https://server.fmode.cn/parse/functions/t012qy4XVe" -Method POST -ContentType "application/json" -Body $body1 -TimeoutSec 15
  11. Write-Host "Response:" -ForegroundColor Green
  12. $r1 | ConvertTo-Json -Depth 5
  13. } catch {
  14. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  15. }
  16. Write-Host ""
  17. # Test getApigAuth (H7X7y9Wfc0)
  18. Write-Host "=== getApigAuth ===" -ForegroundColor Cyan
  19. $body2 = @{
  20. _ApplicationId = "ncloudmaster"
  21. userId = "nd7NOCmFiE"
  22. apigId = "Vo3ROWEvDy"
  23. } | ConvertTo-Json -Compress
  24. try {
  25. $r2 = Invoke-RestMethod -Uri "https://server.fmode.cn/parse/functions/H7X7y9Wfc0" -Method POST -ContentType "application/json" -Body $body2 -TimeoutSec 15
  26. Write-Host "Response:" -ForegroundColor Green
  27. $r2 | ConvertTo-Json -Depth 5
  28. } catch {
  29. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  30. }