1
I am making a very simple Flask Api, I will receive a title and a body in json..
{
"title":"Test",
"body":"test"
}
My app.py class is like this
from flask import Flask, request, jsonify, json
app = Flask(__name__)
@app.route('/item', methods=['POST'])
def addItem():
data = request.get_json()
return jsonify(data)
And I have another class that has a method that gets a title and a body item(title, body)
. So I’d like to know how to transform this json and take these 2 parameters to call this method.
NOTE: I am not using a database, this program is just to get the json and call the method.