Skip to Content
Tkinter GUI Programming by Example
book

Tkinter GUI Programming by Example

by David Love
April 2018
Beginner content levelBeginner
340 pages
7h 54m
English
Packt Publishing
Content preview from Tkinter GUI Programming by Example

Sending a POST request

A POST request allows us to send data over to the server which it can then process as it needs to. It is a common method for saving or updating data that is stored in a database on the server machine.

Let's try this out now; open up your server and add a new endpoint as follows:

from flask import Flask, jsonify, request...@app.route("/send_me_data", methods=["POST"])def send_me_data():    data = request.form    for key, value in data.items():        print("received", key, "with value", value)    return "Thanks"...

This function includes a second argument in the route decorator called methods.  This argument specifies the HTTP methods, which are allowed to be sent to this endpoint. Since we want to send data using a POST request, we ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Bhaskar Chaudhary

Publisher Resources

ISBN: 9781788627481Supplemental Content