Dec-06-2018, 04:45 AM
(Dec-05-2018, 10:19 PM)whatl0ol Wrote: @app.route("/")You're returning an empty json object. That last line should be
def main():
response = requests.get("API",auth=('user', 'pass'))
data = response.json()
return jsonify()
return data
or return jsonify(data)
if you want to send it to the client.(Dec-05-2018, 10:19 PM)whatl0ol Wrote: this code receive data from html form how receive data if user requests for example with curl or something?Exactly the same way. Making a POST request is the same, whether it's from curl or javascript or html-forms. If you use curl to post to
/
, you should get the text.