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