-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
59 lines (36 loc) · 1.38 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "<p>Hello World!</p>"
# from flask import Flask, request, jsonify
# # import werkzeug
# app = Flask(__name__)
# # @app.route('/upload', methods=["POST"])
# # def upload():
# # if(request.method == "POST"):
# # # imagefile = request.files['image']
# # # filename = werkzeug.utils.secure_filename(imagefile.filename)
# # # imagefile.save("./uploadedimages/" + filename)
# # return jsonify({
# # "message": "Image Uploaded Successfully"
# # })
# # @app.route('/', methods=["POST"])
# @app.route('/')
# def hello_world():
# return "Hello World"
# # return jsonify({
# # "message": "Image Uploaded Successfullyyyyyyyyy"
# # })
# if __name__ == "__main__":
# app.run()
# # For Flutter App
# # final request = http.MultipartRequest(
# # "POST", Uri.parse("http://melkamtechnology.com/flask_api/"));
# # final headers = {"Content-type": "multipart/form-data"};
# # request.headers.addAll(headers);
# # final response = await request.send();
# # http.Response res = await http.Response.fromStream(response);
# # final resJson = jsonDecode(res.body);
# # message = resJson['message'];
# # setState(() {});