Magento 标准 API 和根目录下的简单 php 文件之间的区别

difference between Magento standard API and simple php file on the root

使用 magento 创建 api 之间的区别 标准并在根目录中创建一个 php 文件 使用简单的 php 代码获取和发送响应。

  1. 我们使用 magento 标准是否有任何安全原因?
  2. 响应速度有什么不同吗?

is there any security reason we use magento standards ?

标准的 Magento APIs 比任何尚未编写的东西都经过了更多的测试,所以,是的,就安全性而言,最好避免编写自定义的东西。

any difference in speed of response ?

是的,Magento 的 SOAP API非常慢。没有对较新的 REST API 进行太多测试,所以我不确定它是否更快。

第三点,有点明显,是 Magento 的 APIs 已经写好了,可以开箱即用地用于任何站点(只需最少的配置)。编写自定义 API 意味着必须在站点上安装它才能使用。

此外,跳出框框思考,有时将过程逆转是有益的。让 Magento 与 Foo 对话,而不是 Foo 与 Magento 对话。当然,这取决于你在做什么,但有时这是一种更好的实现 Magento 和另一个系统之间通信形式的方法。