Solution: Webhook receiver Python 3.7

Development | Programming languages
5.0 (3 ratings)
Description
Who make a Webhook receiver in Python 3?
Attachments
No attachments
Solutions
Description
Code: receiver.py
from flask import Flask, request, abort
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
    if request.method == 'POST':
        print(request.json)
        return '', 200
    else:
        abort(400)
if __name__ == '__main__':
    app.run()

Start up Postman, and do New Request, POST, URL is http://127.0.0.1:5000/webhook, in Body select "raw" and JSON, and put this in: {"id" : "1123"} and his SEND, and the webhook receiver will print {'id': '1123'}.


on February 08th, 2019 (8:59 pm)
All coments
Postman link please..
on February 08th, 2019 (9:03 pm)

Awesome! Very responsive and got the job done quick and correct



on February 08th, 2019 (9:06 pm)
:)
on February 15th, 2019 (3:48 pm)
You must sign in to comment!! LOGIN
We use cookies to give you the best possible experience on our site. By continuing to use the site you agree to our use of cookies. Find out more Accept