Skip to content

Instantly share code, notes, and snippets.

@mrinalwahal
Created February 3, 2025 16:22
Show Gist options
  • Save mrinalwahal/382a7651176225049e41bd1bfd13bd32 to your computer and use it in GitHub Desktop.
Save mrinalwahal/382a7651176225049e41bd1bfd13bd32 to your computer and use it in GitHub Desktop.
sdt
try {
$url = "https://wahal.free.beeceptor.com"
$body = @{
"key" = "value"
} | ConvertTo-Json
$response = Invoke-WebRequest -Uri $url -Method POST -Body $body -ContentType "application/json"
if ($response.StatusCode -ne 200) {
throw "Request failed with status code: $($response.StatusCode)"
}
} catch {
Write-Host "Error: $_"
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment