commit
5cac63bfbe
1 changed files with 5 additions and 3 deletions
|
@ -2504,9 +2504,11 @@ Here's a simple example:
|
||||||
=== "PowerShell"
|
=== "PowerShell"
|
||||||
``` powershell
|
``` powershell
|
||||||
$uri = "https://ntfy.example.com/mysecrets"
|
$uri = "https://ntfy.example.com/mysecrets"
|
||||||
$headers = @{ Authorization="Basic cGhpbDpteXBhc3M=" }
|
$credentials = 'username:password'
|
||||||
$body = "Look ma, with auth"
|
$encodedcredentials = [convert]::ToBase64String([text.Encoding]::UTF8.GetBytes($Credentials))
|
||||||
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -Headers $headers -UseBasicParsing
|
$headers = @{Authorization="Basic $encodedcredentials"}
|
||||||
|
$message = "Look ma, with auth"
|
||||||
|
invoke-RestMethod -Uri $uri -Body $message -Headers $headers -Method "Post" -UseBasicParsing
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "Python"
|
=== "Python"
|
||||||
|
|
Loading…
Reference in a new issue