看来我的问题和这个一样:Magento Rest Api Invalid XML
但仍然没有人回答。
我刚刚在本地主机上安装了带有示例数据的magento 1.9,并尝试测试rest api。
我在管理面板中设置了rest角色和rest属性。
但当我试图在浏览器中输入以下网址:http://magentohost/api/rest/products?limit=2
我收到回复:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <script/>
  <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
      <faultcode>Sender</faultcode>
      <faultstring>Invalid XML</faultstring>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

错误日志为空,
访问日志:
GET /magentohost/api/rest/products?limit=2 HTTP/1.1" 500

看起来我在设置中漏掉了一些东西..
谢谢你的帮助!

最佳答案

您需要编辑.htaccess文件。
在.htaccess的第12行,取消对“options-multiviews”行的注释。

关于xml - Magento REST API错误:无效的xml,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41950652/

10-11 22:43
查看更多