I send a json file by curl with this command and its work :
curl -X POST -H "Content-Type: application/json" -d @/Users/test/testjson.json 'http://127.0.0.1:5000
I collect this data like and its work :
@app.route('/json_test', methods=['POST'])
def process_data():
# Collect the JSON file from the request
data = json.loads(request.data)
#
I want to add both parameters source
and id
.
How can I send these parameters in Curl
plus my json file . I tried
curl -i -X POST -H "Content-Type: multipart/form-data"
-F "data /Users/test/testjson.json” -F "source=Value1" -F "ident=Value2" http://127.0.0.1:5000
But it's not working
if you can help me to have the command and how i can read this data with python.