小编Biv*_*ali的帖子

如何在 Postman 中上传文件?

我想通过 POSTMAN 中的 POST 方法传递图像,但我在 request.files['image'] 行中得到 None 类型响应

我尝试了很多不同的方法,但无法解决问题。

from flask import Flask,jsonify
from flask import request
import face_recognition
import json

app = Flask(__name__)

@app.route('/')
def index():
   return ''


@app.route('/valid_faces', methods=['POST'])


def POST():
    if request.method == 'POST':

    # getting the images url from the request
    print('....')
    name1 = request.files['file'] if request.files.get('file') else None
    print('....')
    print (name1)        # name2 = request.form.get('name2')

    # map the url to the ones in the folder images
    firstImage = name1


    # loading the image inside …
Run Code Online (Sandbox Code Playgroud)

python flask postman

3
推荐指数
1
解决办法
6305
查看次数

标签 统计

flask ×1

postman ×1

python ×1