How upload image with python requests

file = os.getcwd()+'/'+settings.get('IMAGES_STORE')+'/'+settings.get('APMSIZEIMAGE')+'/'+item.get('images')[0]['path']
        files = {
            'file': open(file, 'rb'),
            'ref': file
        }
        fileResult = requests.post(self.publish_site+'/ghost/api/'+self.admin_api_key_version+'/admin/images/upload/', files=files, headers=headers)

I get 500 Internal Server Error. below server return 500 message

{
    "errors": [
        {
            "message": "Unexpected field",
            "context": null,
            "type": "InternalServerError",
            "details": null,
            "property": null,
            "help": null,
            "code": "LIMIT_UNEXPECTED_FILE",
            "id": "9dd729f0-fa12-11e9-a112-a5155e1b5aef"
        }
    ]
}
Version 2.25.4
Environment development
Database sqlite3
Mail Direct

Hey @huangyanxiong01 :wave: Not really familiar with python but you could take as a reference, this bit for image upload code from Ghost-SDK

https://github.com/TryGhost/Ghost-SDK/blob/master/packages/admin-api/lib/index.js#L168-L187

and

Hope this helps ;)