Answer the question
In order to leave comments, you need to log in
How to accept data (in dictionary format) to the server?
I send data to the local Flask server
import requests
r = requests.post('http://127.0.0.1:5000/', data = {'key1':'value1'})
@app.route('/', methods=['GET', 'POST'])
def server_main():
data = request.form.to_dict(flat=False)
Answer the question
In order to leave comments, you need to log in
Complex structures must be passed in a serialized form. For example in JSON.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question