0

Trying to send messages from python input script to slack app incoming webhook. It doesn't give an error but just accept and doesn't post

print()
name = input("What is your name? ")


def send_slack_message(message: str):

    import requests

    payload = '{"text": "%s"}' % name
    response = requests.post(
        'https://hooks.slack.com/services/*****************',
        data=payload
    )
    print(response.text)


def main(message_text: str):

    send_slack_message(message=message_text)

Max
  • 1
  • what is the `response.status_code`? or likely better `response.raise_for_status()`? – ti7 Aug 23 '22 at 22:46
  • Does this answer your question? [Requests -- how to tell if you're getting a 404](https://stackoverflow.com/questions/15258728/requests-how-to-tell-if-youre-getting-a-404) – ti7 Aug 23 '22 at 22:47

0 Answers0