如何使用curl将文件上传到dict typ中的pythoneve字段

2024-05-15 21:46:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图弄清楚是否可以使用curl(或其他任何真正的方法)将媒体文件上载到dict类型中的python eve字段。你知道吗

文档http://docs.python-eve.org/en/latest/features.html只有

accounts = {
    ...,
    'pic': {'type': 'media'},
    ...
}
curl -F "pic=@profile.jpg"

但是这个呢?你知道吗

accounts = {
    ...,
    'extras': {
        'type': 'dict',
        'schema': {
            'pic': {'type': 'media'},
            ...
        }
    }
}

我试过了 卷曲-F“附加图片=@简介.jpg", 卷曲-F“附加:pic=@profile.jpg" 等等

我也尝试过没有运气的子资源。你知道吗

我要接受的是,我不允许按我的意愿构建我的模式,但如果有办法的话,我很乐意知道。你知道吗


Tags: 方法文档http类型typecurlprofileeve