很长一段时间以来,我一直在使用Magento 2.1.11 Web API将图像上传到我的网站,并且一切正常。我升级到Magento 2.2.7,现在当我尝试相同的POST请求时出现500个内部服务器错误。有谁知道为什么会这样?也许服务器上的某些权限已更改?我正在努力在Google上找到任何东西。以下是我一直在使用的请求。
POST {{URL}} / rest / all / V1 / products / {{SKU}} / media
{
"entry": {
"media_type": "image",
"label": "testImage",
"position":1,
"disabled": false,
"types": [
"image"
],
"file": "testFile",
"content": {
"base64_encoded_data": "base 64 encoded string of image",
"type": "image/jpeg",
"name": "testName.jpg"
}
}
}
感谢您的帮助!