본문 바로가기

Tech/Windows

[텔레그램] 파워쉘 POST 문자열 전송

네이버 공유하기
728x90
            $telegramURI = ("https://api.telegram.org/bot" + $botToken + "/sendMessage")
            $telegramJson = ConvertTo-Json -Compress @{chat_id = $chatID; text='Woo! Fiber is finally avaliable! Go here to sign up: https://www.att.com/internet/fiber.html'}
            $telegramResponse = Invoke-RestMethod -Uri $telegramURI -Method Post -ContentType 'application/json;charset=utf-8' -Body $telegramJson

 

텔레그램 문자 전송시 GET 을 막고 있습니다.

일부 전송에는 잘 되는데, 안되는 곳도 있습니다.

GET 으로 보낼 때 에러가 뜨면 POST 로 전달하면 됩니다.

반응형
네이버 공유하기


* 쿠팡 파트너스 활동을 통해 일정액의 수수료를 제공받을 수 있습니다.