如何在从python Flask服务器获取的本地应用程序上显示图像
从我的expo应用程序中,我想向服务器发出请求。代码如下所示:如何在从python Flask服务器获取的本地应用程序上显示图像,python,react-native,flask,fetch,expo,Python,React Native,Flask,Fetch,Expo,从我的expo应用程序中,我想向服务器发出请求。代码如下所示: fetch('http://caiofernandes.pythonanywhere.com/') .then(res => { console.log(res) }) .catch(error => console.log(error)) 我的flask服务器应该用一个映像进行响应 from flask import Flask fro
fetch('http://caiofernandes.pythonanywhere.com/')
.then(res => {
console.log(res)
})
.catch(error => console.log(error))
我的flask服务器应该用一个映像进行响应
from flask import Flask
from flask_cors import CORS, cross_origin
from flask import send_file
app = Flask(__name__)
CORS(app)
@app.route('/')
@cross_origin()
def hello_world():
return send_file('test100.png', mimetype='image/png')
如何显示服务器返回的图像