1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-11-26 21:25:18 +01:00

Merge pull request #242 from SMAW/patch-2

Update publish.md
This commit is contained in:
Philipp C. Heckel 2022-05-07 13:44:25 -04:00 committed by GitHub
commit 5cac63bfbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"